Bug 411327 - Gwenview fails to open some (not all) Gimp XCF images
Summary: Gwenview fails to open some (not all) Gimp XCF images
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.62.0
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-26 18:41 UTC by zonker.dinger
Modified: 2019-09-21 15:15 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.63
Sentry Crash Report:


Attachments
Example images to demonstrate the problem, in a zip archive (35.19 KB, application/zip)
2019-08-26 18:41 UTC, zonker.dinger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zonker.dinger 2019-08-26 18:41:17 UTC
Created attachment 122377 [details]
Example images to demonstrate the problem, in a zip archive

Recently I noticed that my Gwenview fails to preview/open some Gimp XCF images. Attached to this report are two example images. Gwenview correctly previews/opens the "working_image.xcf". However, the "broken_image.xcf" is displayed with a red "access forbidden" icon in the preview and on a double-click Gwenview shows the error message "Loading 'broken_image.xcf' failed". When I start Gwenview from the command line and try to access the broken image, I see following errors in the console:

QBuffer::seek: Invalid pos: 268500863
Found layer of type RGB but with bpp != 3 268500863
QBuffer::seek: Invalid pos: 268500863
QBuffer::seek: Invalid pos: 268500863
Found layer of type RGB but with bpp != 3 543582572
QBuffer::seek: Invalid pos: 1694498816
Found layer of type RGB but with bpp != 3 0

Gimp itself (version 2.8) can open both images just fine.

I tried to trace this problem back using my system backups and it seems to have been introduced recently. In a system backup from July 2019 (QtCore 5.11.3) I have Gwenview 18.12.3 installed and that version can display/open all Gimp images (including attached examples) without any problems. However, Gwenview 19.08.0 from my current system (QtCore 5.12.3) fails to open some files, as described above.

I'm not sure if this is actually Gwenview's fault, since many packages (especially Qt, but also some graphics-related packages like Babl or Exiv2) were updated in the last few months. However, I'm currently at a loss about how to proceed with debugging this problem. Could someone check if their recent Gwenview version is able to open both images please? If the problem doesn't occur for other people here, then some hints about which library could be causing the problem would be of really great help to me.
Comment 1 Christoph Feck 2019-09-17 02:53:38 UTC
Confirmed. Going back to 19f33239e7a76697aa98af5428f0bbd9cfc7b740 and the XCF loader loads both images again.

A lot of fuzzing tests have resulted in patches that could have caused a regression.
Comment 2 Albert Astals Cid 2019-09-17 23:05:36 UTC
ouch, sorry about this, i'll have a look tomorrow
Comment 3 maderios 2019-09-18 09:10:00 UTC
Like all image viewers, Gwenview 19.08.1 is unable to display Gimp 2.10 multi-layers  XCF thumbnails and images. Only Gimp 2.10 can display new XCF files format. It's a real problem...
Comment 4 Albert Astals Cid 2019-09-18 09:59:28 UTC
That's a different issue unrelated to this one. 

And it's already reported elsewhere. Please don't hijack bugs
Comment 5 maderios 2019-09-18 11:53:34 UTC
Sorry, it was badly expressed. I just wanted to say that it's not a bug for XCF created with Gimp 2.10. At this time, Kimageformats doesn't support XCF created with Gimp 2.9 and 2.10. That's why it's important to specify which Gimp version is used to create these XCF.
Comment 6 Albert Astals Cid 2019-09-20 14:32:11 UTC
zonker.dinger do you give us permission to add these files to our regression test suite so we don't break them again?
Comment 7 zonker.dinger 2019-09-20 15:48:51 UTC
@Albert: Feel free to use the files in any way you wish :-)
Comment 8 Albert Astals Cid 2019-09-20 20:41:28 UTC
Git commit 5c4c05257cd89ab4a082169db3f15c9998f79135 by Albert Astals Cid.
Committed on 20/09/2019 at 20:41.
Pushed by aacid into branch 'master'.

xcf: Fix regression when reading files with "unsupported" properties

Summary:
The fact that we don't know the property is most of the times not fatal,
so what we have to do is just "skip" the property and hope for the best

Reviewers: cfeck, apol, vkrause

Reviewed By: vkrause

Subscribers: kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D24114

M  +6    -1    src/imageformats/xcf.cpp

https://commits.kde.org/kimageformats/5c4c05257cd89ab4a082169db3f15c9998f79135
Comment 9 zonker.dinger 2019-09-21 10:51:07 UTC
Great! Many thanks! Keep up the good work! :-D