GNOME Bugzilla – Bug 569550
Can not handle PSD layers/groups
Last modified: 2015-11-30 14:43:19 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.
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.
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.
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.
@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.
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.
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?
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)
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.
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.
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
Created attachment 185509 [details] [review] patch for layer group importing from PSD files trying that again, now with proper formatting, hopefully
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.
Thanks :) Now we just need somebody with a PSD collection to test this patch and give their OK.
Created attachment 185553 [details] more complex test file with nested transparency
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!!
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)
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.
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
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).
(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.
*** Bug 650739 has been marked as a duplicate of this bug. ***
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 :).
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.
Thanks all. Now I'll see if I can't properly implement text layer importing.
I would say the complaining period is over, please push.
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.