Commit 5582efd6 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

when we encounter an unsupported merge operation (merging an opaque

2007-11-13  Sven Neumann  <sven@gimp.org>

	* app/core/gimpimage-merge.c (gimp_image_merge_layers): when we
	encounter an unsupported merge operation (merging an opaque
	indexed layer onto an indexed layer with alpha channel), then 
add
	an alpha channel and try again. Fixes bug #496437.


svn path=/trunk/; revision=24149
parent ac39ccfb
2007-11-13 Sven Neumann <sven@gimp.org>
* app/core/gimpimage-merge.c (gimp_image_merge_layers): when we
encounter an unsupported merge operation (merging an opaque
indexed layer onto an indexed layer with alpha channel), then add
an alpha channel and try again. Fixes bug #496437.
2007-11-13 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpviewrenderer.c (gimp_view_renderer_draw): use
......
......@@ -295,6 +295,16 @@ gimp_image_merge_visible_vectors (GimpImage *image)
/* private functions */
static CombinationMode
gimp_image_merge_layers_get_operation (GimpLayer *dest,
GimpLayer *src)
{
GimpImageType type = gimp_drawable_type (GIMP_DRAWABLE (dest));
gint bytes = gimp_drawable_bytes (GIMP_DRAWABLE (src));
return gimp_image_get_combination_mode (type, bytes);
}
static GimpLayer *
gimp_image_merge_layers (GimpImage *image,
GSList *merge_list,
......@@ -442,9 +452,8 @@ gimp_image_merge_layers (GimpImage *image,
else
{
/* The final merged layer inherits the name of the bottom most layer
* and the resulting layer has an alpha channel
* whether or not the original did
* Opacity is set to 100% and the MODE is set to normal
* and the resulting layer has an alpha channel whether or not the
* original did. Opacity is set to 100% and the MODE is set to normal.
*/
merge_layer =
......@@ -500,9 +509,16 @@ gimp_image_merge_layers (GimpImage *image,
/* determine what sort of operation is being attempted and
* if it's actually legal...
*/
operation =
gimp_image_get_combination_mode (gimp_drawable_type (GIMP_DRAWABLE (merge_layer)),
gimp_drawable_bytes (GIMP_DRAWABLE (layer)));
operation = gimp_image_merge_layers_get_operation (merge_layer, layer);
if (operation == -1)
{
gimp_layer_add_alpha (layer);
/* try again ... */
operation = gimp_image_merge_layers_get_operation (merge_layer,
layer);
}
if (operation == -1)
{
......
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