After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 730787 - GIMP saves corrupt xcf files on mac os X
GIMP saves corrupt xcf files on mac os X
Status: RESOLVED DUPLICATE of bug 730211
Product: GIMP
Classification: Other
Component: General
2.8.10
Other Mac OS
: Normal blocker
: ---
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2014-05-27 06:56 UTC by Daniel Savi
Modified: 2014-05-27 15:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
layers recovered (303.13 KB, image/x-compressed-xcf)
2014-05-27 10:49 UTC, Massimo
  Details
quick hack (3.39 KB, patch)
2014-05-27 10:54 UTC, Massimo
none Details | Review
image recovered (312.25 KB, image/x-compressed-xcf)
2014-05-27 15:01 UTC, Massimo
  Details

Description Daniel Savi 2014-05-27 06:56:40 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.
Comment 1 Daniel Savi 2014-05-27 08:31:52 UTC
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.
Comment 2 Michael Schumacher 2014-05-27 09:04:21 UTC
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 ***
Comment 3 Massimo 2014-05-27 10:49:31 UTC
Created attachment 277274 [details]
layers recovered

this is the file that I recovered. Can you confirm that all
layers are there?
Comment 4 Massimo 2014-05-27 10:54:53 UTC
Created attachment 277275 [details] [review]
quick hack

and this is a quick and dirty hack that allows GIMP
to read these files
Comment 5 Daniel Savi 2014-05-27 11:24:01 UTC
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.
Comment 6 Daniel Savi 2014-05-27 11:36:59 UTC
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.
Comment 7 Daniel Savi 2014-05-27 12:13:28 UTC
Link to another file with the same issue (110 MB!):
http://www.gaess.ch/pics/FotoBueroBroschuere.xcf
Comment 8 Massimo 2014-05-27 15:01:31 UTC
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.
Comment 9 Massimo 2014-05-27 15:13:30 UTC
(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.
Comment 10 Daniel Savi 2014-05-27 15:29:14 UTC
(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.
Comment 11 Daniel Savi 2014-05-27 15:30:16 UTC
(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!