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 317044 - Empty layers vanish from Photoshop files (PSD)
Empty layers vanish from Photoshop files (PSD)
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.2.x
Other All
: Normal normal
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2005-09-23 15:40 UTC by Joachim Noreiko
Modified: 2008-01-15 13:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Testcase PSD file. Contains background + 2 layers: 'empty' and 'not empty' (28.87 KB, application/octet-stream)
2005-09-23 20:45 UTC, Joachim Noreiko
  Details
attempt at fixing the problem as discussed (10.46 KB, patch)
2006-02-14 12:28 UTC, Sven Neumann
committed Details | Review

Description Joachim Noreiko 2005-09-23 15:40:20 UTC
Distribution/Version: Gimp.app

Using Photoshop (I did this with 8.0 for OS X), save a PSD file with at least
one empty layer (and any other content you like).
Open it in GIMP, and the empty layer is not there.

Going the other way is fine: empty layer in a PSD saved with GIMP is there when
opened in Photoshop. Though if you then save the document in Photoshop, it will
be gone again in GIMP.
Comment 1 Sven Neumann 2005-09-23 19:24:13 UTC
What's your definition of an empty layer?
Comment 2 Joachim Noreiko 2005-09-23 20:21:14 UTC
Create a layer containing transparency. Don't do anything else to it.
In Photoshop, that's just Layer > New > Layer... and press OK.
In GIMP, Layer > New Layer and leave fill type as transparency.
Comment 3 Sven Neumann 2005-09-23 20:38:04 UTC
Can you please attach a small PSD file that shows the problem?
Comment 4 Joachim Noreiko 2005-09-23 20:45:59 UTC
Created attachment 52575 [details]
Testcase PSD file. Contains background + 2 layers: 'empty' and 'not empty'

When I open this file in Photoshop, I see all three layers. In GIMP, the empty
layer is missing.
Comment 5 Joachim Noreiko 2005-09-23 21:11:48 UTC
Oops, bugzilla didn't like that. Changing the file extension of the attachment
to PSD after downloading works fine (or rather, it doesn't, if you see what I
mean ;)
Comment 6 Manish Singh 2005-09-23 21:27:05 UTC
The empty layer is of size 0x0. This is explicitly filtered out as "bad" by the
fix for bug #122602, since in GIMP's layer paradigm, a 0-sized layer is nonsensical.

Perhaps 0-sized layers from a PSD should be a fully transparent layer that has
the same dimensions of the background layer. Thoughts on this?
Comment 7 Michael Natterer 2005-09-23 21:57:51 UTC
Since PS seems to automatically extend layers while you draw on them,
a newly created layer would have 0x0 pixels. We should create a
transparent layer of image size.
Comment 8 Sven Neumann 2006-02-14 12:28:22 UTC
Created attachment 59332 [details] [review]
attempt at fixing the problem as discussed
Comment 9 Sven Neumann 2006-03-09 11:17:53 UTC
I have committed this change to the HEAD branch in the hope that it will get some testing there. I am leaving this bug report open until we have decided if we want to merge this change into the stable branch or not.
Comment 10 Alan Horkan 2006-03-13 22:46:22 UTC
I had a similar problem to this (did a quick search and I don't think I filed a specific bug for it at the time).  I created a test PSD file with a bunch of named layers (each layer was named and colour coded using a highlight/labelling feature from Photoshop 7) but when i opened the file those layers had "disappeared" because just as in this bug the layers were empty, although I had gone to the trouble of naming all those layers.  So the fix in this bug would help prevent the loss of named layers which haven't yet been painted on but certainly aren't useless.  

[Found my earlier comment which i think is related though the rest of the bug report is about a differnt issue:
http://bugzilla.gnome.org/show_bug.cgi?id=142468#c16
"i had a test file with some (named but otherwise) empty "coloured layers" which
disappeared".]

Comment 11 Michael Schumacher 2006-03-13 23:32:45 UTC
Does this test file load correctly now?

I've tried some of the files that were attached to bug #122602, its dupes and other PSD-related reports in Bugzilla, and they seem to have more layers (empty + image size) now than compared to loading them in GIMP 2.2. So I guess that the fix works as intended.
Comment 12 Carol 2006-04-26 15:47:57 UTC
It works here, I am closing this bug report.
Comment 13 Nickolay V. Shmyrev 2007-01-30 23:12:00 UTC
Hey guys, the following problem. I have an image created with photoshop cs2 and it have 962 layers and most of them are empty. Since this patch applied, gimp is unable to open this image due to the lack of memory. Can this code be optimized to take less memory on empty layers?
Comment 14 Sven Neumann 2007-01-30 23:30:08 UTC
Not easily.
Comment 15 Nickolay V. Shmyrev 2007-02-01 14:33:22 UTC
Hm, I've gone though the code, it might be problem really. But there is no technical reason to avoid layers with 0 x 0 dimension. Sven, can you describe the steps that one should do to implement support for such layers? Probably we can just deny drawing on them, it will be easier than to extend layer after drawing as in PhotoShop.
Comment 16 Sven Neumann 2007-02-01 22:53:57 UTC
This will become no problem when we have done the switch to GEGL as that should allow us to implement unbounded layers and also to special case empty layers. But this bug report is not the right place to discuss this.