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 569550 - Can not handle PSD layers/groups
Can not handle PSD layers/groups
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
2.6.4
Other All
: Normal enhancement
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
: 650739 (view as bug list)
Depends on: 86337
Blocks:
 
 
Reported: 2009-01-28 18:35 UTC by Tomas Vera
Modified: 2015-11-30 14:43 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
contains 2 screen caps (197.06 KB, application/octet-stream)
2009-01-28 18:50 UTC, Tomas Vera
  Details
PSD file with nested groups made in CS5 (273.90 KB, image/vnd.adobe.photoshop)
2011-01-11 22:41 UTC, David Lichterman
  Details
patch for layer group importing from PSD files (10.42 KB, patch)
2011-04-08 09:43 UTC, David Lichterman
none Details | Review
patch for layer group importing from PSD files (10.42 KB, patch)
2011-04-08 09:59 UTC, David Lichterman
none Details | Review
patch for layer group importing from PSD files (10.22 KB, patch)
2011-04-08 10:03 UTC, David Lichterman
none Details | Review
more complex test file with nested transparency (248.32 KB, image/vnd.adobe.photoshop)
2011-04-08 21:26 UTC, David Lichterman
  Details

Description Tomas Vera 2009-01-28 18:35:15 UTC
Please describe the problem:
GIMP is not displaying layers in PSD format files properly.
PSD Layer groups are not "grouped" and the layers are not displayed in the correct location.
This results in images that look "jumbled".

Steps to reproduce:
1. Open a PSD file that contains layer groups.
2. Compare with original image (can use Irfan viewer to see the proper layout)
3. 


Actual results:
The image opens with no warnings or messages.
You will notice that the image layers are not in the proper location, some effects are missing, and layer groups are not "grouped".

Expected results:
The image layers should be displayed in the proper location.

Does this happen every time?
yes.

Other information:
I have a PSD source file and some screen caps comparing what GIMP displays and what Irfan Viewer displays.
Comment 1 Tomas Vera 2009-01-28 18:50:45 UTC
Created attachment 127413 [details]
contains 2 screen caps

This is a ZIP file containing 2 screen caps.
One screen cap shows GIMP with the PSD loaded and the second screen cap shows Irfan Viewer with the same PSD loaded.
This will illustrate how GIMP is not handling the layers properly.
Comment 2 Martin Nordholts 2009-01-28 18:56:47 UTC
Hi and thanks for the bug report! It's not like we didn't know of this though... Anyway, I've confirmed this and made it dependent on the layer groups-bug.
Comment 3 Tor Lillqvist 2009-03-08 12:18:20 UTC
Tomas, just a friendly advice for the future: If you are attaching just two screenshots, don't bother storing them in a zip file. Just attach each screenshot separately. Having them in a zip file just makes it a little bit harder to view them, and makes it a little bit less likely that somebody bothers to.
Comment 4 flxCore 2010-03-12 09:54:01 UTC
@Martin: Could you provide a link to the layer groups-bug ? 
We'd like to vote for the layer grouping feature! It is really needed in Gimp.
Comment 5 Michael Natterer 2010-03-12 13:58:46 UTC
Voting doesn't help a bit, only contributing patches does.

Besides, the list of dependent bugs is right on this page, and layer
groups are already implemented.
Comment 6 Daniel Currier 2010-06-25 03:11:29 UTC
Thanks for addressing this issue. This is one thing that is really needed. Michael, when you say that "layer groups are already implemented," are you saying that someone has this working? If so, do you know when this patch will be out?
Comment 7 David Lichterman 2011-01-11 22:41:54 UTC
Created attachment 178098 [details]
PSD file with nested groups made in CS5

layering is as follows:
EmptyGroup (group)
Group 1 (group)
|->Group2 (group)
   |->hey yo1 (text layer)
|->Group 3 (group)
   |->hey yo2 (text layer)
hey yo (text layer)
Comment 8 David Lichterman 2011-01-20 11:12:21 UTC
i've worked on a partial fix for this, but in order to complete the nesting of layers, https://bugzilla.gnome.org/show_bug.cgi?id=612931 needs fixing, i believe.
Comment 9 Michael Natterer 2011-01-20 13:45:23 UTC
That bug is a pure user interface thing and unrelated here.

The whole API to support layer groups in plug-ins should be there,
but please report anything that's missing.
Comment 10 David Lichterman 2011-04-08 09:43:55 UTC
Created attachment 185508 [details] [review]
patch for layer group importing from PSD files

huzzah! a patch lives! this is my first commit to GIMP, so apologies in advance for whatever bugs I just introduced
Comment 11 David Lichterman 2011-04-08 09:59:05 UTC
Created attachment 185509 [details] [review]
patch for layer group importing from PSD files

trying that again, now with proper formatting, hopefully
Comment 12 David Lichterman 2011-04-08 10:03:36 UTC
Created attachment 185511 [details] [review]
patch for layer group importing from PSD files

sorry for the spam... i'm a git newbie. this looks right.
Comment 13 Michael Natterer 2011-04-08 20:57:10 UTC
Thanks :) Now we just need somebody with a PSD collection to test
this patch and give their OK.
Comment 14 David Lichterman 2011-04-08 21:26:53 UTC
Created attachment 185553 [details]
more complex test file with nested transparency
Comment 15 Carlos Perelló Marín 2011-04-08 21:40:17 UTC
I have several .psd with layers on folders, so I will try to get a build with this patch applied an give some feedback. However, I cannot share those .psd files...

I will try it tomorrow and keep you informed. Thanks for this patch!!
Comment 16 Martin Nordholts 2011-04-09 08:49:34 UTC
Instead of making a one-time manual test that your patch works, we should test that your patch works each night (to ensure there are no regressions)

I encourage you to add a test to app/tests/test-xcf.c (or as a second choice: app/tests/test-save-and-export.c)

Our CI server Jenkins will then run this test each night:
http://gimptest.flamingtext.com:8080/
(right now it temporarily fails to run tests)
Comment 17 David Lichterman 2011-04-09 21:17:59 UTC
as much as I'm a proponent of testing new features, there doesn't seem to be any precedent for testing PSD importing and since this is my first patch to GIMP and I don't know the code base well at all, I'd need a lot of mentoring. I'm not sure the patch is worth delaying for the above reason.
Comment 18 Martin Nordholts 2011-04-10 10:06:59 UTC
You'd load the .psd file in the same way the .png file in imported_file_uris() in app/tests/test-save-and-export.c is loaded, and you'd examine the structure of the returned GimpImage using code similar to gimp_assert_mainimage() in app/tests/test-xcf.c
Comment 19 Florian Klink 2011-04-30 15:11:11 UTC
Tested the patch from #12 with 2.7.2, applied cleanly.

Opened my psd file correctly, now with layer groups :-) No strange things occured so far ;-)

For the GUI:

You can toggle visibility of layer groups by clicking the eye in front of the group in the layer dock, and all subelements show/hide correctly in the image.

But it is very confusing to see all those "normal state" eyes in the "sublayers" in the dock.
You can't see if this layer group is visible or not, only by looking at the parent group (Which can be out of sight if you have a lot of elements in the group).

Could you add a "normally visible, but hidden at the moment because complete layer group is hidden"-state? (maybe a greyed-out eye, or greyed out layer names).
Comment 20 David Lichterman 2011-05-01 00:54:46 UTC
(In reply to comment #19)
> Tested the patch from #12 with 2.7.2, applied cleanly.
> 
> Opened my psd file correctly, now with layer groups :-) No strange things
> occured so far ;-)
> 
> For the GUI:
> 
> You can toggle visibility of layer groups by clicking the eye in front of the
> group in the layer dock, and all subelements show/hide correctly in the image.
> 
> But it is very confusing to see all those "normal state" eyes in the
> "sublayers" in the dock.
> You can't see if this layer group is visible or not, only by looking at the
> parent group (Which can be out of sight if you have a lot of elements in the
> group).
> 
> Could you add a "normally visible, but hidden at the moment because complete
> layer group is hidden"-state? (maybe a greyed-out eye, or greyed out layer
> names).

this patch and this bug is only concerning the PSD file loading, and is not related to the GUI. The GUI/functionality bug is https://bugzilla.gnome.org/show_bug.cgi?id=86337

Martin: I'm not going to add tests for this. I'm not paid to do this work and the PSD file loading plugin is poorly designed, which is why saving PSDs lags so far behind loading them. Were I to invest significant time into this plugin, I'd rewrite it with a properly thought out design.
Comment 21 Mikael Magnusson 2011-05-21 15:29:39 UTC
*** Bug 650739 has been marked as a duplicate of this bug. ***
Comment 22 Mikael Magnusson 2011-05-21 19:14:02 UTC
I've tested the patch with the supplied .psd files and it does seem to create groups correctly, and no warnings when compiling. I'll commit it with some cosmetic changes if nobody complains. If anyone wants to write a test, they can do so whenever they want :).
Comment 23 Michael Natterer 2011-05-21 19:16:09 UTC
I agree, we shouldn't let good patches rot just because there is no test,
and having that feature will spare us a million duplicates while we're
supposed to focus on 2.10.
Comment 24 David Lichterman 2011-05-21 19:17:37 UTC
Thanks all. Now I'll see if I can't properly implement text layer importing.
Comment 25 Michael Natterer 2011-05-23 17:45:25 UTC
I would say the complaining period is over, please push.
Comment 26 Mikael Magnusson 2011-05-23 18:04:07 UTC
pushed

commit ba324c06f54ad351f1fd22193a9a97ea63b08fb1
Author: Dave Lichterman <laviddichterman@gmail.com>
Date:   Fri Apr 8 02:38:40 2011 -0700

    Bug 569550 - Can not handle PSD layers/groups

    Add support to file-psd plugin for layer group reading.