This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Turning .zip files into readable .kra files?

Tags: None
(comma "," separated)
whittlemario
Registered Member
Posts
2
Karma
0
Hello, I was working on an animation when my .kra file got corrupted. I've already gone through the steps to uncorrupt it by using a zip repair program and comparing it to the contents of a non-corrupted .kra file everything seems to be there. However, when I try to change it back to a .kra file Krita can't seem to open the file and gives me the error that the file 'maindoc.xml' is missing. I've checked and double-checked the restored file's contents though, and it's definitely not missing. I did some experimenting with an uncorrupted file and it seems like the error happened because the file was extracted and then rezipped before being turned back into a .kra file. I was wondering if there was any way to fix this error and make my .kra file readable again.
ahabgreybeard
Registered Member
Posts
1269
Karma
11
OS
whittlemario wrote:... because the file was extracted and then rezipped before being turned back into a .kra file. I was wondering if there was any way to fix this error and make my .kra file readable again.

You don't need to Extract the contents of the .kra file before using the Ziprepair utility on it. The Ziprepair utility operates on a .zip file.

You rename filename.kra as filename.zip (because it really is a .zip file, internally) then run Ziprepair on it, then rename it as filename.kra.
That process may, or may not, work to fix a corrupted .kra file.

Do you have an untouched copy of the original .kra file that you can do the process on again?

whittlemario wrote:... Krita can't seem to open the file and gives me the error that the file 'maindoc.xml' is missing.

Is that also the error message you got when you first tried to open the corrupted .kra file?
If so, it may be that you haven't actually changed anything inside the .kra file, so you could try Ziprepair again, as I explained above.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
What most likely happened is that the folder the unzipped contents were in was used as the the base.

Say, you unzip the kra to ~/bla or c:\users\user\bla, then zip up the bla folder, instead of the contents of the bla folder. The zipped kra file will then have bla\maindoc.xml instead of maindoc.xml in the root of the file.
whittlemario
Registered Member
Posts
2
Karma
0
Sorry for the confusion, I did use the zip repair tool on the .zip file, it just gave me the files in an unzipped folder that I had to rezip. As for the second solution, that worked perfectly! It looks like I lost some parts of my layers, but now that I know I have to zip the contents directly I can try to repair the file again. Thank you so much for all of your help!


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell