GNOME Bugzilla – Bug 730787
GIMP saves corrupt xcf files on mac os X
Last modified: 2014-05-27 15:30:16 UTC
When saving some of my files, they cannot be reopened. Instead, I'm just getting an empty picture all tranparent and a message in the status bar: "Can't work on an empty image, add a layer first". So far this only happened with two files containing two layers and the top layer being less than 100% opaque. Both layers have an alpha channel as well. They are also rather big pictures with more than 1000px in each dimension. I am saving the file to an smb share. I'm uploading one file as an example to my webserver. You can get the file with this link: www.gaess.ch/pics/Grundriss_1OG_Bereiche_markiert.xcf So far, I'couldn't reproduce the error by creating a new file.
I've just remembered, that exporting the image to a PNG file didn't work for both images as well. A dialog appeared, saying something like "cannot save to png file" and the created png file was having 0 Bytes.
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. *** This bug has been marked as a duplicate of bug 730211 ***
Created attachment 277274 [details] layers recovered this is the file that I recovered. Can you confirm that all layers are there?
Created attachment 277275 [details] [review] quick hack and this is a quick and dirty hack that allows GIMP to read these files
Thank you for the quick answer, Massimo. I think that the top layer is missing from the recovered file. I've also uploaded the jpg export I've made one minute after saving the now corrupted xcf file here: http://www.gaess.ch/pics/Grundriss_1OG_Armierung.jpg As you can see, I've had another layer added and the two you have recovered have been invisible. Given the save time for the jpg being just one minute after the xcf, I'm pretty sure that the layer was alread there when saving the xcf. I'm also trying to use your C-program from bug 730211 to recover the file on my linux machine. So far, I didn't succeed. I gonna try some more. Adding the diff is not so easy here on my mac, because I'm using the binary distributed GIMP and don't have any compile chain installed.
I'm actually quite unsure whether I just didn't save the last step when working on the file or not. So, the recovered image may be correct indeed. I've got a second image with the same problem, but it is 110MB. I'm uploading it to my webpage now, but it will take a while. For this file I do know exactly how it should look like. If you like, I could check this file as well after you've recovered it. I'm going to post the link as soon as it will be available.
Link to another file with the same issue (110 MB!): http://www.gaess.ch/pics/FotoBueroBroschuere.xcf
Created attachment 277307 [details] image recovered yes you are right, in the patch above I added a check that moved the file pointer after the first layer and then it was skipped. Regarding the visibilty it is possible that I altered it before resaving.
(In reply to comment #7) > Link to another file with the same issue (110 MB!): > http://www.gaess.ch/pics/FotoBueroBroschuere.xcf Here it is possible to recover an image 4000x2340 with 2 layers (Hintergrund and Hintergrund copy) the copy being a 'photocopy' of the first. bzipped is 36 MB. If you need it tell me where to upload it or if you want I'll email it to the address that you use for this bugzilla.
(In reply to comment #9) > (In reply to comment #7) > > Link to another file with the same issue (110 MB!): > > http://www.gaess.ch/pics/FotoBueroBroschuere.xcf > > Here it is possible to recover an image 4000x2340 > with 2 layers (Hintergrund and Hintergrund copy) > the copy being a 'photocopy' of the first. > > bzipped is 36 MB. If you need it tell me where to > upload it or if you want I'll email it to the address > that you use for this bugzilla. Thank you very much for restoring the image. It's very kind of you and saves me some work! Sending me an E-Mail would be the easiest for me.
(In reply to comment #8) > Created an attachment (id=277307) [details] > image recovered > > yes you are right, in the patch above I added a check > that moved the file pointer after the first layer and > then it was skipped. Regarding the visibilty it is possible > that I altered it before resaving. Now, the image is perfectly restored. Thank you very much again!