From 8d53675d9f350af8531951efa25e514ff51b5f6c Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Thu, 13 Feb 2025 12:01:13 +0000 Subject: [PATCH] libgimp: Convert floating selection to layer on export On export, when GIMP_EXPORT_CAN_HANDLE_LAYERS is not set but GIMP_EXPORT_NEEDS_ALPHA is, we merge all layers in the image. If there's a floating selection however, its attached layer is not included in the exported image. This patch converts the floating selection to a regular layer so that both are included in the final export. --- libgimp/gimpexportoptions.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libgimp/gimpexportoptions.c b/libgimp/gimpexportoptions.c index f43d32c7d1..78f3e3b413 100644 --- a/libgimp/gimpexportoptions.c +++ b/libgimp/gimpexportoptions.c @@ -50,9 +50,15 @@ static void export_merge (GimpImage *image, GList **drawables) { - GList *layers; - GList *iter; - gint32 nvisible = 0; + GList *layers; + GList *iter; + GimpLayer *floating_sel; + gint32 nvisible = 0; + + /* Convert floating selection to layer if it exists */ + floating_sel = gimp_image_get_floating_sel (image); + if (floating_sel) + gimp_floating_sel_to_layer (floating_sel); layers = gimp_image_list_layers (image);