From b67e28526b4fe637b2988760586dbc5810543b1b Mon Sep 17 00:00:00 2001 From: Nick Lamb /GIMP Date: Mon, 10 Apr 2000 01:46:51 +0000 Subject: [PATCH] Eeek! Change gimpexport as per my original post to gimp-devel --- ChangeLog | 6 ++++++ libgimp/gimpexport.c | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0f86a2ec3..fbb8d62405 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2000-04-10 Nick Lamb + + * libgimp/gimpexport.c: Eeek! Sven only half implemented my + change. Now if the background isn't visible we will suggest + "Merge Visible" as expected. + 2000-04-07 Sven Neumann * libgimp/gimpexport.c: implemented the changes Nick Lamb diff --git a/libgimp/gimpexport.c b/libgimp/gimpexport.c index 581a6fa352..7b5a26c789 100644 --- a/libgimp/gimpexport.c +++ b/libgimp/gimpexport.c @@ -456,7 +456,7 @@ gimp_export_image (gint32 *image_ID, gint32 nlayers; gint32* layers; gboolean added_flatten = FALSE; - gboolean background_has_alpha = FALSE; + gboolean background_has_alpha = TRUE; ExportAction *action; g_return_val_if_fail (*image_ID > -1 && *drawable_ID > -1, FALSE); @@ -473,9 +473,6 @@ gimp_export_image (gint32 *image_ID, { if (gimp_drawable_has_alpha (layers[i])) { - if (i == nlayers - 1) - background_has_alpha = TRUE; - if ( !(capabilities & CAN_HANDLE_ALPHA) ) { @@ -486,6 +483,11 @@ gimp_export_image (gint32 *image_ID, } else { + /* If this is the last layer, it's visible and has no alpha + channel, then the image has a "flat" background */ + if (i == nlayers - 1 && gimp_layer_get_visible(layers[i])) + background_has_alpha = FALSE; + if (capabilities & NEEDS_ALPHA) { actions = g_slist_prepend (actions, &export_action_add_alpha);