From a723fe27b35b542a6723688bba9eac41e3bb3329 Mon Sep 17 00:00:00 2001 From: Alx Sa Date: Sat, 15 Mar 2025 04:26:14 +0000 Subject: [PATCH] plug-ins: Fix crash when exporting indexed ICNS images Resolves #12880 Same problem as in 4cd3360d, just applied to exported ICNS icons instead. --- plug-ins/file-icns/file-icns-export.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plug-ins/file-icns/file-icns-export.c b/plug-ins/file-icns/file-icns-export.c index 7f0d5ae7a2..879b4ef37a 100644 --- a/plug-ins/file-icns/file-icns-export.c +++ b/plug-ins/file-icns/file-icns-export.c @@ -563,6 +563,10 @@ icns_export_image (GFile *file, /* TODO: Use GimpExportOptions for this when available */ temp_image = gimp_image_new (width, height, gimp_image_get_base_type (image)); + if (gimp_image_get_base_type (image) == GIMP_INDEXED) + gimp_image_set_palette (temp_image, + gimp_image_get_palette (image)); + temp_layer = gimp_layer_new_from_drawable (GIMP_DRAWABLE (iter->data), temp_image); gimp_image_insert_layer (temp_image, temp_layer, NULL, 0);