Save a file in kra format result in various data losses: in one file I had only empty layers and offset image (the offset is cropped so it's definitely lost). In some files I only had the offset... STEPS TO REPRODUCE 1. Draw 2. save as ORA 3. open the ORA file OBSERVED RESULT A corrupted image. Openable with the right layer structure but missing content EXPECTED RESULT A useable file with everything ora supports in place SOFTWARE/OS VERSIONS macOS: catalina 10.15.5 on a 2018 15' macbook pro I misstyped kra into ora (k and o are close) and I lost a drawing (completely empty layers) Maybe that's a dangerous short-circuit ?
* This is only about ora, right? Not .kra like you say in the first page? * Could you start Krita from Terminal.app like /Applications/krita/MacOS/Content/krita (or was it /Applications/krita/Content/MacOS/krita ?) and check whether there are errors like this: libpng warning: Image width is zero in IHDR libpng warning: Image height is zero in IHDR libpng error: Invalid IHDR data I have just checked by saving a complex .kra file as ora, and one layer was invalid and both the mergedimage.png and the preview.png seemed corrupt.
Oh, and can you attach one of the krita files that saved as a broken file as well, or make a link so I can download them?
Created attachment 129815 [details] my original corrupted file Sure! Here you go!
since it's empty, the file was super light :D
* I was able to reproduce a broken with the krita/4.3 branch * It doesn't look like a problem with calculating the end projection, because that's fine in Manga Tengu's test file, though it was broken in mine.
My broken file and the source kra are here: https://www.dropbox.com/s/ab1vpg9q8gt594z/broken_ora.ora?dl=0 https://www.dropbox.com/s/euj549z9ba1fh3w/hylti_p28_0002.kra?dl=0
Git commit 925bf97f8d4ed1101267fd86d99536069a05f969 by Agata Cacko. Committed on 04/07/2020 at 17:33. Pushed by tymond into branch 'master'. Fix saving broken .ora file in case of empty layer Before this commit, saving an empty layer to .ora would result in a broken file because the result PNG for the layer would be 0x0. This commit artificially increases the size of the layer with one pixel when the layer is empty to make sure there is some data (even if invisible) to save to PNG file. M +6 -0 plugins/impex/ora/kis_open_raster_stack_save_visitor.cpp https://invent.kde.org/graphics/krita/commit/925bf97f8d4ed1101267fd86d99536069a05f969
Git commit 0401b14169964fcb69dc04cc613f6a9ef04ec3ea by Agata Cacko. Committed on 04/07/2020 at 17:33. Pushed by tymond into branch 'master'. Don't save fake nodes in .ora files Before this commit, Krita would try to save reference images layer into .ora files. Since reference images layer doesn't have any projection (and the name for the layer is 'No Name'...), it would result in a ghost new layer on top of the layer stack called 'No Name'. Since there is no projection nor other information, there is no point in saving it to .ora files. This commit omits reference images layer (and other fake nodes) when saving to .ora. M +4 -0 plugins/impex/ora/kis_open_raster_stack_save_visitor.cpp https://invent.kde.org/graphics/krita/commit/0401b14169964fcb69dc04cc613f6a9ef04ec3ea
Note: while I fixed Boud's issue and I cannot reproduce any visible issue with the following files: - `hylti` from bug 423741 (this one) - `input.kra` version 1 from bug 423088 comment 0 - `input.kra` version 2 from bug 423088 comment 1 - `input.kra` version 2 from bug 423088 comment 3 (bug 423088 was related) in all three: Krita, Gimp and MyPaint, I didn't find and fix any reason for the damage that @Manga Tengu experienced. So please, if it happens again and you have a proper .kra file to see the damage, reopen this bug report and attach the .kra file that results in a broken .ora file.
Git commit ca26fdaa72cd038173200f5114720b0f595b56b9 by Agata Cacko. Committed on 04/07/2020 at 20:16. Pushed by tymond into branch 'krita/4.3'. Fix saving broken .ora file in case of empty layer Before this commit, saving an empty layer to .ora would result in a broken file because the result PNG for the layer would be 0x0. This commit artificially increases the size of the layer with one pixel when the layer is empty to make sure there is some data (even if invisible) to save to PNG file. (cherry picked from commit 925bf97f8d4ed1101267fd86d99536069a05f969) M +6 -0 plugins/impex/ora/kis_open_raster_stack_save_visitor.cpp https://invent.kde.org/graphics/krita/commit/ca26fdaa72cd038173200f5114720b0f595b56b9
Git commit 28827e81f5a1eee5326319cc7d05e3879fbfd0c1 by Agata Cacko. Committed on 04/07/2020 at 20:17. Pushed by tymond into branch 'krita/4.3'. Don't save fake nodes in .ora files Before this commit, Krita would try to save reference images layer into .ora files. Since reference images layer doesn't have any projection (and the name for the layer is 'No Name'...), it would result in a ghost new layer on top of the layer stack called 'No Name'. Since there is no projection nor other information, there is no point in saving it to .ora files. This commit omits reference images layer (and other fake nodes) when saving to .ora. (cherry picked from commit 0401b14169964fcb69dc04cc613f6a9ef04ec3ea) M +4 -0 plugins/impex/ora/kis_open_raster_stack_save_visitor.cpp https://invent.kde.org/graphics/krita/commit/28827e81f5a1eee5326319cc7d05e3879fbfd0c1
Created attachment 129901 [details] a kra file that has been cropped at a moment
Created attachment 129902 [details] an ora file after a kra file that has been cropped you can see there is data loss
I linked 2 files myHouse.kra myHouse.ora I have nailed the reproduction a bit better: you need to crop the file before exporting it to ora. Then you will see the ora file cropped even more and left an empty gap
@MangaTengu - I can reproduce it in 4.3.0 but I cannot reproduce it after my changes (and InkLab's), so I think I (and/or them) fixed it :) (It's definitely a matter of incorrect bounds). Please download the next stable version and check if it's correct. And yes, this corruption looks similar to the original corrupted file (messed up x and y), so I guess we can leave it fixed (unless you find some files that contradicts my conclusions in the Krita version after my changes).
Sure will do ! Thank you ! :-)
Git commit ff86577290ffe77e0304141a375e9b6a8fcd7a22 by Agata Cacko. Committed on 04/07/2020 at 21:32. Pushed by tymond into branch 'krita/4.3.0'. Fix saving broken .ora file in case of empty layer Before this commit, saving an empty layer to .ora would result in a broken file because the result PNG for the layer would be 0x0. This commit artificially increases the size of the layer with one pixel when the layer is empty to make sure there is some data (even if invisible) to save to PNG file. M +6 -0 plugins/impex/ora/kis_open_raster_stack_save_visitor.cpp https://invent.kde.org/graphics/krita/commit/ff86577290ffe77e0304141a375e9b6a8fcd7a22