From 3a698a05a1da766d851a82bb5f916da70c82fe55 Mon Sep 17 00:00:00 2001 From: Jehan Date: Mon, 29 Sep 2025 17:40:57 +0200 Subject: [PATCH] plug-ins: only set the file if it's actually an inner XCF file. Soon we will officially support .hgt.zip files (see !2483) but in fact, even without this, the file-compressor actually support any other formats we support, compressed into one of the container formats supported by this plug-in. This fixes such error message: > gimp_image_set_file: failure to set file 'file:///home/jehan/Documents/gimp-splash-deleteme.png.gz' with extension 'gz'. The extension must be '.xcf' (or a compressed variant). --- plug-ins/common/file-compressor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plug-ins/common/file-compressor.c b/plug-ins/common/file-compressor.c index 42be16423b..89d9e5b629 100644 --- a/plug-ins/common/file-compressor.c +++ b/plug-ins/common/file-compressor.c @@ -526,9 +526,17 @@ load_image (const CompressorEntry *compressor, if (image) { + GFile *xcf_file; + *status = GIMP_PDB_SUCCESS; - gimp_image_set_file (image, file); + if ((xcf_file = gimp_image_get_xcf_file (image))) + /* Replace the temporary file with the actual source file, but + * only if the inner format was actually XCF. + */ + gimp_image_set_file (image, file); + + g_clear_object (&xcf_file); } else {