Hi, This afternoon, I drew many things with krita-4.2.0-alpha-ca5aeb7-x86_64.appimage and saved many *.kra files. No issue in particular, exept for the last file here: https://www.peppercarrot.com/extras/temp/2019-05-14_B_Gitlab.kra - Dolphin can't generate a thumbnail for it, while I never had a problem with other kra. - Nomacs (my viewer) can't preview the *.kra, while I never had a problem with other kra too. - Krita 4.1x can't read it (invalid file), while ok for other kra... - I can open it in 4.2x; but when I "save as" it does the same type of file each time. So, I guess something is wrong with this *.kra file. Two paint layers, one group; nothing complex. I checked with Ark (unzip app), it has thumbnail, mergedimage.png. I can't figure why it is not a standard *.kra file. (Note: zip64 unchecked in *.kra preferences.) Thanks for the help!
Hi Deevad, I can confirm the issue. I will take a look into it tomorrow morning.
* Ark can open the zip file: ark doesn't use karchive * unzip can open the zip file and zip can zip it up so 4.1.7 can open it * The problem is not that the file is in 64 bits mode
kzip says: "Invalid ZIP file. Unrecognized header at offset 9476582" I think that an unrecognized header should not be a reason for failure, but I also wonder why master currently gives this error while I've been swapping 4.1 and master for tests all the time :-(
Git commit 2ce21f054b903a84e11f9300cea2e2eec24982a6 by Boudewijn Rempt. Committed on 16/05/2019 at 09:32. Pushed by rempt into branch 'master'. Add a legacy zip store that uses KArchive KArchive's KZip cannot read all files that Quazip saves. This is a bug in KArchive, but it breaks older versions of krita that cannot load some files saved in 4.2 anymore. So, only use quazip if 64 bits saving is enabled. M +1 -0 CMakeLists.txt M +2 -0 libs/store/CMakeLists.txt A +272 -0 libs/store/KoLegacyZipStore.cpp [License: LGPL (v2+)] A +73 -0 libs/store/KoLegacyZipStore.h [License: LGPL (v2+)] M +28 -2 libs/store/KoStore.cpp M +2 -0 libs/store/KoStore_p.h https://invent.kde.org/kde/krita/commit/2ce21f054b903a84e11f9300cea2e2eec24982a6
The file linked to in the report can be read with most zip tools, but not kzip. I think that this is a bug in kzip's zip implementation.
Git commit e752d278e48b984f80286c9d0016c69b17d522d4 by Boudewijn Rempt. Committed on 16/05/2019 at 09:44. Pushed by rempt into branch 'krita/4.2'. Add a legacy zip store that uses KArchive KArchive's KZip cannot read all files that Quazip saves. This is a bug in KArchive, but it breaks older versions of krita that cannot load some files saved in 4.2 anymore. So, only use quazip if 64 bits saving is enabled. M +1 -0 CMakeLists.txt M +2 -0 libs/store/CMakeLists.txt A +272 -0 libs/store/KoLegacyZipStore.cpp [License: LGPL (v2+)] A +73 -0 libs/store/KoLegacyZipStore.h [License: LGPL (v2+)] M +28 -2 libs/store/KoStore.cpp M +2 -0 libs/store/KoStore_p.h https://invent.kde.org/kde/krita/commit/e752d278e48b984f80286c9d0016c69b17d522d4
I built the fix and I confirm it is fixed. I could 'save as' the two problematics *.kra with git~master and they immediately recovered a preview thumbnail in Dolphin and are now readable by my image viewer. Thank you Boud!
Git commit 4cb990274f8664d4eb3311af7755c8ff6065150c by Boudewijn Rempt. Committed on 17/05/2019 at 09:40. Pushed by rempt into branch 'master'. Add a legacy zip store for writing backwards-compatible kra files Use the Quazip store for reading and writing 64 bits zip files, the Legacy store for writing 32 bits zip files. It's still not ideal, having two zip implementations (and a third one hidden inside Qt), but this gives maximal compatibility. Vectors and colorize masks load again as well. Related: bug 407601, bug 407630 M +1 -0 CMakeLists.txt M +2 -0 libs/store/CMakeLists.txt A +272 -0 libs/store/KoLegacyZipStore.cpp [License: LGPL (v2+)] A +73 -0 libs/store/KoLegacyZipStore.h [License: LGPL (v2+)] M +27 -2 libs/store/KoStore.cpp M +2 -0 libs/store/KoStore_p.h https://invent.kde.org/kde/krita/commit/4cb990274f8664d4eb3311af7755c8ff6065150c
Git commit 77d87639051c2115aa516897cbb094cc4d8bbb19 by Boudewijn Rempt. Committed on 18/05/2019 at 06:43. Pushed by rempt into branch 'krita/4.2'. Add a legacy zip store for writing backwards-compatible kra files Use the Quazip store for reading and writing 64 bits zip files, the Legacy store for writing 32 bits zip files. It's still not ideal, having two zip implementations (and a third one hidden inside Qt), but this gives maximal compatibility. Vectors and colorize masks load again as well. Related: bug 407601, bug 407630 M +1 -0 CMakeLists.txt M +2 -0 libs/store/CMakeLists.txt A +272 -0 libs/store/KoLegacyZipStore.cpp [License: LGPL (v2+)] A +73 -0 libs/store/KoLegacyZipStore.h [License: LGPL (v2+)] M +27 -2 libs/store/KoStore.cpp M +2 -0 libs/store/KoStore_p.h https://invent.kde.org/kde/krita/commit/77d87639051c2115aa516897cbb094cc4d8bbb19
Looked at the attached file with a hex editor. I think the problem is that quazip writes weird data_descriptor sizes (gpf bit 8 is set so we have to guess the next header, and seekToNextHeaderToken ends up 12 bytes after where it should be, which is coincidentally the size of the data descriptor). I guess the quazip people misunderstood the "optional" part in the spec (you either write the whole data descriptor or you don't, you don't just write the signature). Or I'm reading something wrong.
gog