when transforming a selection in an indexed image, we used to create an

2000-05-20  Sven Neumann  <sven@gimp.org>

* 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.


--Sven
This commit is contained in:
Sven Neumann 2000-05-20 10:49:03 +00:00 committed by Sven Neumann
parent 0b4a743a25
commit 03b2e9d08a
3 changed files with 37 additions and 16 deletions

View File

@ -1,3 +1,16 @@
2000-05-20 Sven Neumann <sven@gimp.org>
* 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 <sven@gimp.org>
* plug-ins/common/sample_colorize.c: reset progress to 0.0 when

View File

@ -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 */

View File

@ -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 */