Bug 491795 - KImageformats doesn't display some XCF files created with Gimp 3
Summary: KImageformats doesn't display some XCF files created with Gimp 3
Status: CONFIRMED
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 6.5.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-08-16 16:50 UTC by maderios
Modified: 2026-04-07 06:03 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description maderios 2024-08-16 16:50:30 UTC
STEPS TO REPRODUCE
1. Open a tif file in Gimp git version, use it as background layer
2. Add other tif file as layer on the top of background layer
3. Right click on layer -> trans parency -> color to alpha
4. Save file as .xcf
5. Open this file in Digikam git 

OBSERVED RESULT
File and/or thumbail are not displayed
See attachment example image
When I convert this file to .psd then to .xcf, Kimageformats can display it

SOFTWARE/OS VERSIONS
Arch Linux
Qt 6.7.2
KF6 6.5
Gimp 2.99  fd3d547338 commit
Comment 2 Albert Astals Cid 2024-08-19 22:33:13 UTC
Mirco is this something that you could have a look?
Comment 3 Mirco Miranda 2024-08-23 09:46:47 UTC
The plugin supports up to version 12 of the XCF format. We are now at 20 or 21 in GIMP 2.99 and they will continue to add features until the official release.

Looking at it now doesn't make much sense.

I just tried to remove the rejection based on the version number and the image loads although the result is different than in GIMP 2.99 (which is a good sign).
Comment 4 maderios 2024-08-23 09:54:14 UTC
(In reply to Mirco Miranda from comment #3)
> The plugin supports up to version 12 of the XCF format. We are now at 20 or
> 21 in GIMP 2.99 and they will continue to add features until the official
> release.
Official Gimp 3.0 release is very near now, they don't add features:  
GIMP 3.0 Enters String Freeze   
https://x.com/GIMP_Official/status/1825949792821981472

> 
> Looking at it now doesn't make much sense.
> 
> I just tried to remove the rejection based on the version number and the
> image loads although the result is different than in GIMP 2.99 (which is a
> good sign).
Comment 5 maderios 2025-03-15 20:01:56 UTC
Fresh news
core: Add version 23 to XCF switch statement
https://gitlab.gnome.org/GNOME/gimp/-/commit/206273c6b5da01d42c816056afacf98b29c97e00
Comment 6 maderios 2025-07-15 20:08:40 UTC
I found out why some XCF files/images created with Gimp 3  and later are not displayed in Digikam/KImage formats. Two causes.
1)  Gimp V3 introduced "non destructive editing"    
This "non destructive editing" is not supported by KImageformats: if I uncheck "fx" (see Ofnuts explanations in forum link below)  next the layer for images affected with issue, images are displayed normally, but i loose filter effect :(
https://www.gimp-forum.net/Thread-Non-destructive-editing-in-Gimp3
https://www.gimp.org/news/2025/06/23/gimp-3-1-2-released/#non-destructive-editing
2)  KImageformat can't handle "better compression" (zlib compression, i think) available in saving options.
Comment 7 maderios 2025-07-17 12:36:13 UTC
I found another reason why KImageformats can't display some Gimp 3 XCF files inside Digikam
1) open tif file with Gimp 3. This file is displayed normally by Kimageformats inside Digikam
2) convert it to XCF format with Gimp 3
3) This file is no more displayed by Kimageformats
Comment 8 maderios 2025-07-17 12:38:37 UTC
(In reply to maderios from comment #7)
> I found another reason why KImageformats can't display some Gimp 3 XCF files
> inside Digikam
> 1) open tif file with Gimp 3. This file is displayed normally by
> Kimageformats inside Digikam
> 2) convert it to XCF format with Gimp 3
> 3) This file is no more displayed by Kimageformats

To know: this issue doesn't happen with png and jpeg files
Comment 9 Mirco Miranda 2025-07-19 08:59:27 UTC
The current implementation of the plugin supports XCF files up to version 12 (GIMP 2.10 without zlib compression support).

The plugin rejects all XCF files with versions greater than 12.
Comment 10 maderios 2025-07-30 08:20:23 UTC
(In reply to maderios from comment #1)
> Image link here
> https://www.dropbox.com/scl/fi/lm0xxqbofilvu65wvh6bp/jun16-3-color2alpha.
> xcf?rlkey=mw7blqojtw2zor1hfkc9ewgds&st=cq9dtojo&dl=0

New link   now   https://www.dropbox.com/scl/fi/lbflec0bnusogjwcbth4o/jun16-3-color2alpha-bug-fx.xcf?rlkey=m6a9ehc9py2f1wxtnbik9cfwn&st=wg7ueri0&dl=0
Comment 11 fch22 2025-11-13 10:00:40 UTC
similar problem with GIMP 3.0.6 and digikam 8.8 on Win11
when editing a file with gimp, after savinf the xcf file,  thumbnail is no more visible
I checked in the layer view , the flag Fx is unset for each layer (and in any case , not able to set it), unless this can be configured somewhere else and "Better compression" seems also unset 
(refering to comments from maderios)
Comment 12 nkirk 2026-03-15 00:48:15 UTC
Gimp 3.0.8 .xcf file thumbnails do not display
- same issue with Gimp 3.0.8 .xcf files
Dolphin is unable to display the thumbnail graphic

SOFTWARE/OS VERSIONS
Operating System: Fedora Linux 43
KDE Plasma Version: 6.6.2
KDE Frameworks Version: 6.23.0
Qt Version: 6.10.2
Kernel Version: 6.18.16-200.fc43.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 13 Méven Car 2026-03-24 15:28:56 UTC
Trying to show the image with proper debugging revealed:
```
QT_LOGGING_RULES="kf.imageformats.plugins.xcf.debug=true" dolphin 
kf.imageformats.plugins.xcf: version 22
kf.imageformats.plugins.xcf: Unsupported version 22
kf.imageformats.plugins.xcf: version 22
kf.imageformats.plugins.xcf: Unsupported version 22
kf.kio.gui: PreviewJob subjob had an error: ""
kf.imageformats.plugins.xcf: XCF: read called on non-XCF file
````

Looking at the code, the zlib compression is not supported, but should be now more common with recent gimp version.
Comment 14 Méven Car 2026-03-24 15:30:56 UTC
The format is documented at https://testing.developer.gimp.org/core/standards/xcf/
Comment 15 Méven Car 2026-03-24 15:37:05 UTC
It seems gnome-xcf-thumbnailer does not support those either.
Comment 16 Mirco Miranda 2026-04-02 10:18:45 UTC
I created a script in Gimp 3 to convert the XCF to PNG under Windows. I tested it with jun16-3-color2alpha-bug-fx.xcf and it worked.
We could modify the plugin so that, if it fails to load, it tries to run the conversion with gimp-console and then load the PNG file. We already do something similar with the EPS plugin (it uses Ghostscript). Obviously, you need to have GIMP installed.

It's not an ideal solution, but it's better than nothing...

=== START BAT ===

@echo off
title Converting XCF → PNG...
set "GIMP_PATH=C:\Users\Programs Files\GIMP 3\bin\gimp-console.exe"

:: Process all XCF files in the folder
for %%f in (*.xcf) do (
    if exist "%%f" (
        echo.
        echo Processing: %%f
        "%GIMP_PATH%" -i --batch-interpreter=plug-in-script-fu-eval -b "(let* ((image (car (gimp-file-load RUN-NONINTERACTIVE \"%%f\" \"%%f\"))) ) (file-png-export RUN-NONINTERACTIVE image \"%%~nf.png\")) (gimp-quit 0)"
        if errorlevel 1 (
            echo ERROR during conversion of %%f
        ) else (
            echo Converted to: %%~nf.png
        )
    )
)

echo.
echo ==============================
echo  CONVERSION COMPLETED!
echo  PNG files were created in the same folder of XCF ones.
echo ==============================

=== END BAT ===
Comment 17 Albert Astals Cid 2026-04-04 20:33:24 UTC
> It's not an ideal solution, but it's better than nothing...

I don't know, i am not convinced, otherwise we could end up just be calling imagemagik's convert for all the things?
Comment 18 Mirco Miranda 2026-04-04 20:44:28 UTC
(In reply to Albert Astals Cid from comment #17)
> > It's not an ideal solution, but it's better than nothing...
> 
> I don't know, i am not convinced, otherwise we could end up just be calling
> imagemagik's convert for all the things?

Last time I checked It does not support GIMP 3 images. Same for xcftools.
Comment 19 Albert Astals Cid 2026-04-04 21:57:06 UTC
(In reply to Mirco Miranda from comment #18)
> (In reply to Albert Astals Cid from comment #17)
> > > It's not an ideal solution, but it's better than nothing...
> > 
> > I don't know, i am not convinced, otherwise we could end up just be calling
> > imagemagik's convert for all the things?
> 
> Last time I checked It does not support GIMP 3 images. Same for xcftools.

I didn't mean for this in particular, but for other file formats since there is defenitely file formats imagemagik supports and we do not.
Comment 20 Albert Astals Cid 2026-04-04 21:57:51 UTC
I think at the end of the day the user should be responsible for some of its file format management.
Comment 21 maderios 2026-04-05 09:50:52 UTC
There's new project here:
'This tool is a thumbnailer for XDG desktops. It generates thumbnails for XCF image files (and compressed variants) using GIMP in batch mode. It uses gimp-console when available, otherwise it uses gimp without interface.'
https://github.com/illwieckz/gimp-thumbnailer

Discussion about XCF thumbnails with Jehan Gimp developer (in french)
https://linuxfr.org/news/gimp-3-2-0-est-sorti
Comment 22 Mirco Miranda 2026-04-07 06:03:57 UTC
(In reply to Albert Astals Cid from comment #19)

> I didn't mean for this in particular, but for other file formats since there
> is defenitely file formats imagemagik supports and we do not.

As soon as I have a moment, I'll do some tests on a few formats we're missing. I've used it in the past to create images for our test cases with poor results (in practice, I've always had to use something else). Using imagemagick probably involves switching to an intermediate file type (e.g. PNG)... so, in my opinion, it only makes sense if we have no other option.

Up until now, I've limited myself to supporting what Photoshop supports. I already have the code ready to open MTV and Faberfeld images: I was hesitant to include them in KImageFormats given their limited use.