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.
This commit is contained in:
Alx Sa 2025-02-13 12:01:13 +00:00
parent 3d6a27570f
commit 8d53675d9f

View file

@ -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);