Commit b94fc9f7 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann
Browse files

invalidate layer previews so we don't crash when an image preview is

2002-04-28  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage-convert.c (gimp_image_convert): invalidate layer
	previews so we don't crash when an image preview is generated after
	converting the image from RGB to GRAY.

	* app/core/gimpimage.c (gimp_image_get_new_preview): added some
	assertions to make it easier to find similar problems in the future.
parent d465ced0
2002-04-28 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-convert.c (gimp_image_convert): invalidate layer
previews so we don't crash when an image preview is generated after
converting the image from RGB to GRAY.
* app/core/gimpimage.c (gimp_image_get_new_preview): added some
assertions to make it easier to find similar problems in the future.
2002-04-24 Sven Neumann <sven@gimp.org>
 
* plug-ins/gfig/gfig.c
......
......@@ -1023,6 +1023,7 @@ gimp_image_convert (GimpImage *gimage,
gimp_image_colormap_changed (gimage, -1);
#endif
gimp_image_invalidate_layer_previews (gimage);
gimp_image_mode_changed (gimage);
gimp_unset_busy (gimage->gimp);
......
......@@ -733,6 +733,7 @@ gimp_image_get_new_preview (GimpViewable *viewable,
break;
default:
bytes = 0;
g_assert_not_reached ();
break;
}
......@@ -802,6 +803,10 @@ gimp_image_get_new_preview (GimpViewable *viewable,
y1 * src1PR.rowstride + x1 * src1PR.bytes);
layer_buf = gimp_viewable_get_preview (GIMP_VIEWABLE (layer), w, h);
g_assert (layer_buf);
g_assert (layer_buf->bytes <= comp->bytes);
src2PR.bytes = layer_buf->bytes;
src2PR.w = src1PR.w;
src2PR.h = src1PR.h;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment