SUMMARY Cannot open .kra file (attached) in latest development version. Git commit id: 3805574 (built on March 13, appimage from https://binary-factory.kde.org/job/Krita_Nightly_Appimage_Build/406/). File opens fine in Krita 4.1.7. STEPS TO REPRODUCE 1. Open attached file in Krita 2. Error message displayed. 3. After that file opens, but all layers are empty. OBSERVED RESULT File opens, but all layers are empty. EXPECTED RESULT File should be open normally. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Linux Mint 19 Mate edition ADDITIONAL INFORMATION
If the file is too large to attach, please use a dropbox or google drive link, or something like that.
Got it! Here is the affected file ^__^ - https://download.morevnaproject.org/public/118-5-storyboard-54-7-bug.kra
That's curious... Krita ought to save layer names as UTF-8, but what's in this file is definitely not UTF-8, when I check when unzipping it. Weirder still, we can still show the layernames in what I assume is the correct representation in the dev version.
What is the locale of the system the file was saved on?
If I open with 4.1.7 on a system with LANG=en_US.UTF-8 and save it, the file can be read with the latest master. Somehow, 4.1.7 saves the image name (which is used in the path to the layers) with the local encoding instead of UTF-8.
Git commit f4a4194125d4b152aabc5662bf09191df998c638 by Boudewijn Rempt. Committed on 15/03/2019 at 09:09. Pushed by rempt into branch 'master'. Fix problems when loading Krita 4.1 files saved in non-utf-8 locales Krita 4.1 has a bug where when the locale is not utf-8, the entries in the zip file entrylist are in the local locale, not utf-8. The image name is encoded in utf-8 in the maindoc.xml file, but the layers are, because of ancient history when more than one image could be stored in a kra file, in a subfolder with the image name. So, if the image name in utf-8 is different from the image name in the directory, quazip gets confused because it actually handles encoding correctly. Ark also cannot load kra files that are borked in this with. This hack substitutes the encoded name for the utf-8 name in the quazip store implementation, and now the files can load again. M +13 -6 libs/store/KoQuaZipStore.cpp M +7 -0 libs/store/KoStore.cpp M +3 -0 libs/store/KoStore.h M +3 -0 libs/store/KoStore_p.h M +12 -0 plugins/impex/kra/kra_converter.cpp M +5 -1 plugins/impex/libkra/kis_kra_loader.cpp M +6 -0 plugins/impex/libkra/kis_kra_loader.h https://commits.kde.org/krita/f4a4194125d4b152aabc5662bf09191df998c638
Thank you for the fix! Just some additional info: The file was created in Krita 4.1.7 on Linux. Then edited in Krita (probably 4.1.7) on Windows. After that it faile to open on Linux with dev version. Opening file in Krita 4.1.7 on Linux AND re-saving it (even without any LANG tweaks) fixes the problem. ^__^
Then I strongly suppose that the Windows system was set to a non-utf-8 locale :-)
Git commit 3a4bfb2858415cf6fdec2a7d8e6cef97c2f218a0 by Boudewijn Rempt. Committed on 04/04/2019 at 09:09. Pushed by rempt into branch 'master'. Fix loading kra files with / in the image name Related: bug 405942 M +1 -4 libs/store/KoQuaZipStore.cpp M +5 -0 libs/store/KoStore.cpp M +7 -1 libs/store/KoStore.h M +3 -3 plugins/impex/kra/kra_converter.cpp https://commits.kde.org/krita/3a4bfb2858415cf6fdec2a7d8e6cef97c2f218a0