diff --git a/ChangeLog b/ChangeLog index df49d9c818..e154941fff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2000-05-20 Sven Neumann + + * app/transform_core.c (transform_core_cut): when transforming + a selection in an indexed image, we used to create an indexed + tile_buffer. This gives strange (black) results later when we + use layer_new_from_tiles() since that function assumes that a + TileManager is always RGB or GRAY. Eeek!! + + Instead of fixing it correctly by changing the TileManager + struct, I've unset the keep_indexed flag when calling + gimage_mask_extract(), so whatever layer_new_from_tiles() + assumes becomes true. Fixes bug #10762. + 2000-05-20 Sven Neumann * plug-ins/common/sample_colorize.c: reset progress to 0.0 when diff --git a/app/tools/transform_core.c b/app/tools/transform_core.c index c32628f4f3..cdc17c6188 100644 --- a/app/tools/transform_core.c +++ b/app/tools/transform_core.c @@ -40,9 +40,6 @@ #include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" -#define BILINEAR(jk,j1k,jk1,j1k1,dx,dy) \ - ((1-dy) * (jk + dx * (j1k - jk)) + \ - dy * (jk1 + dx * (j1k1 - jk1))) /* variables */ static TranInfo old_trans_info; @@ -1192,17 +1189,20 @@ transform_core_do (GImage *gimage, { case RGB_GIMAGE: case RGBA_GIMAGE: bg_col[ALPHA_PIX] = TRANSPARENT_OPACITY; - alpha = 3; + alpha = ALPHA_PIX; break; case GRAY_GIMAGE: case GRAYA_GIMAGE: bg_col[ALPHA_G_PIX] = TRANSPARENT_OPACITY; - alpha = 1; + alpha = ALPHA_G_PIX; break; case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: bg_col[ALPHA_I_PIX] = TRANSPARENT_OPACITY; - alpha = 1; + alpha = ALPHA_I_PIX; /* If the gimage is indexed color, ignore smoothing value */ - interpolation = 0; + interpolation = FALSE; + break; + default: + g_assert_not_reached (); break; } @@ -1576,7 +1576,11 @@ transform_core_cut (GImage *gimage, /* extract the selected mask if there is a selection */ if (! gimage_mask_is_empty (gimage)) { - tiles = gimage_mask_extract (gimage, drawable, TRUE, TRUE, TRUE); + /* set the keep_indexed flag to FALSE here, since we use + layer_new_from_tiles() later which assumes that the tiles + are either RGB or GRAY. Eeek!!! (Sven) + */ + tiles = gimage_mask_extract (gimage, drawable, TRUE, FALSE, TRUE); *new_layer = TRUE; } /* otherwise, just copy the layer */ diff --git a/app/transform_core.c b/app/transform_core.c index c32628f4f3..cdc17c6188 100644 --- a/app/transform_core.c +++ b/app/transform_core.c @@ -40,9 +40,6 @@ #include "libgimp/gimpintl.h" #include "libgimp/gimpmath.h" -#define BILINEAR(jk,j1k,jk1,j1k1,dx,dy) \ - ((1-dy) * (jk + dx * (j1k - jk)) + \ - dy * (jk1 + dx * (j1k1 - jk1))) /* variables */ static TranInfo old_trans_info; @@ -1192,17 +1189,20 @@ transform_core_do (GImage *gimage, { case RGB_GIMAGE: case RGBA_GIMAGE: bg_col[ALPHA_PIX] = TRANSPARENT_OPACITY; - alpha = 3; + alpha = ALPHA_PIX; break; case GRAY_GIMAGE: case GRAYA_GIMAGE: bg_col[ALPHA_G_PIX] = TRANSPARENT_OPACITY; - alpha = 1; + alpha = ALPHA_G_PIX; break; case INDEXED_GIMAGE: case INDEXEDA_GIMAGE: bg_col[ALPHA_I_PIX] = TRANSPARENT_OPACITY; - alpha = 1; + alpha = ALPHA_I_PIX; /* If the gimage is indexed color, ignore smoothing value */ - interpolation = 0; + interpolation = FALSE; + break; + default: + g_assert_not_reached (); break; } @@ -1576,7 +1576,11 @@ transform_core_cut (GImage *gimage, /* extract the selected mask if there is a selection */ if (! gimage_mask_is_empty (gimage)) { - tiles = gimage_mask_extract (gimage, drawable, TRUE, TRUE, TRUE); + /* set the keep_indexed flag to FALSE here, since we use + layer_new_from_tiles() later which assumes that the tiles + are either RGB or GRAY. Eeek!!! (Sven) + */ + tiles = gimage_mask_extract (gimage, drawable, TRUE, FALSE, TRUE); *new_layer = TRUE; } /* otherwise, just copy the layer */