Bug 485420 - Opening xcf files returns an empty canvas
Summary: Opening xcf files returns an empty canvas
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: 5.2.2
Platform: Appimage Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-12 08:38 UTC by David REVOY
Modified: 2024-04-30 09:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
A sample XCF file (41kb). A red 256x256 square, three layers, written 'TEST' on it. (41.32 KB, image/x-xcf)
2024-04-12 08:38 UTC, David REVOY
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David REVOY 2024-04-12 08:38:17 UTC
Created attachment 168414 [details]
A sample XCF file (41kb). A red 256x256 square, three layers, written 'TEST' on it.

Hi, opening xcf files (Gimp files) is broken: the files return an empty canvas, no layers at all, but the resolution loads correctly. I attached a sample xcf file, but it's possible to reproduce with any xcf by generating your own.

Tested on Appimage 5.2.2, Fedora KDE.
Comment 1 Halla Rempt 2024-04-12 10:29:14 UTC
Ah, that's a version 11 xcf -- which Krita doesn't support because xcftools was never updated to support it.
Comment 2 David REVOY 2024-04-12 15:43:34 UTC
Thank you, @Halla, for taking a look!

That's what I thought, xcftools being under the hood.

It's not a Krita bug then, but a problem of unmaintained upstream.
Feel free to switch the report to RESOLVED/UPSTREAM.

In an ideal world, maybe a dialog informing about the unsupported xcf version would be great in this case. But I also know developing such a dialog would probably take hours of dev time for a very niche case and a probably very small audience.
Comment 3 Halla Rempt 2024-04-15 13:16:29 UTC
xcftools then tries to load the file anyway, so are not getting an error -- but if every version 11 file doesn't load, we can change that.
Comment 4 Halla Rempt 2024-04-30 09:10:29 UTC
Git commit ba2cac104fc3434fa74677602a7e5a98b29c12a9 by Halla Rempt.
Committed on 30/04/2024 at 09:10.
Pushed by rempt into branch 'krita/5.2'.

Show and error when trying to import version 3 xcf files

xcftools cannot handle versions > 2, even though it promises to
try, it always fails. So add the same check instead of > 3 to
our import code.

(cherry picked from commit 1129754df83ad77e7514aec5ee0053a5ab0ac991)

M  +1    -1    plugins/impex/xcf/kis_xcf_import.cpp

https://invent.kde.org/graphics/krita/-/commit/ba2cac104fc3434fa74677602a7e5a98b29c12a9