Bug 435402 - gwenview fails to show .kra image
Summary: gwenview fails to show .kra image
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kimageformats
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.80.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Alex Merry
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-06 00:25 UTC by Deri James
Modified: 2024-12-19 17:16 UTC (History)
6 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Deri James 2021-04-06 00:25:20 UTC
SUMMARY


STEPS TO REPRODUCE
1. Save to a .kra file
2. Use gwenview to browse directory
3. See thumbnail of drawing, click to view image

OBSERVED RESULT
"Loading meta information failed"

EXPECTED RESULT
Show full size image (mergedimage.png).

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.20.4
KDE Frameworks Version: 5.76.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

I believe this started in 4.3 onwards. If I run the command "file" on a selection of .kra files:-

[derij@pip Pictures]$ file *.kra
2nd.kra:                            Zip data (MIME type "application/x-krita"?)
3rd.kra:                            Zip data (MIME type "application/x-krita"?)
Canal.kra:                          Zip data (MIME type "application/x-krita"?)
dj.kra:                             Zip data (MIME type "application/x-krita"?)
Garden1.kra:                        Zip data (MIME type "application/x-krita"?)
geograph-2710464-by-John-Finch.kra: Zip data (MIME type "application/x-krita"?)
Inlet.kra:                          data
Lake2.kra:                          data
Lake.kra:                           Zip data (MIME type "application/x-krita"?)
Mount.kra:                          data
MountPractice2.kra:                 Zip data (MIME type "application/x-krita"?)
MountPractice.kra:                  Zip data (MIME type "application/x-krita"?)
NZ.kra:                             Zip data (MIME type "application/x-krita"?)
Pond2.kra:                          data
Pond.kra:                           data
sea1.kra:                           data
TreeMountainLake.kra:               Zip data (MIME type "application/x-krita"?)
Vera.kra:                           data
Wales2.kra:                         Zip data (MIME type "application/x-krita"?)
Wales.kra:                          data
WalledGarden.kra:                   Zip data (MIME type "application/x-krita"?)
Waterfall.kra:                      data

The files which are simply "data" are post 4.3, the ones with application/x-krita are from earlier versions and open correctly in gwenview. "file" uses the magic file to determine file type which contains the following comment:-

# Specialised zip formats which start with a member named 'mimetype'
# (stored uncompressed, with no 'extra field') containing the file's MIME type.
# Check for have 8-byte name, 0-byte extra field, name "mimetype", and
#  contents starting with "application/":

The 4.3 version of .kra has compressed the mimetype file so it is not recognised as application/x-krita. If I unzip the file to a directory and do:-

zip  -X -r ../Wales2.kra mimetype maindoc.xml documentinfo.xml preview.png Wales/ mergedimage.png

It produces a .kra file which is recognised as the correct mime type and is opened by gwenview. The -X is required to stop zip adding an "extra field".

Of course, this could be a problem which requires a more up to date magic file, which has been updated to cater for this change in krita's file format.
Comment 2 Nate Graham 2021-04-06 14:47:40 UTC

*** This bug has been marked as a duplicate of bug 362999 ***
Comment 3 Maik Qualmann 2021-06-17 15:49:36 UTC
*** Bug 438807 has been marked as a duplicate of this bug. ***
Comment 4 Mirco Miranda 2024-12-19 14:06:21 UTC
On KDE 5 (Debian) I saved a .KRA from Krita 5.2.3. Dolphin shows the preview and Gwenview opens it without problems. Please attach a .kra showing the problem (if it still exists).
Comment 5 Deri James 2024-12-19 17:16:45 UTC
Marking as resolved, new and ancient .kra files preview fine.