Summary: | KArchive cannot read some files created with quazip | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-karchive | Reporter: | David REVOY <info> |
Component: | general | Assignee: | David Faure <faure> |
Status: | CONFIRMED --- | ||
Severity: | critical | CC: | halla, kdelibs-bugs, martin.sandsmark, qusaialkateeb1 |
Priority: | NOR | Keywords: | regression, release_blocker |
Version: | 5.58.0 | ||
Target Milestone: | --- | ||
Platform: | Appimage | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
David REVOY
2019-05-14 19:45:38 UTC
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 |