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 753986 - file-psd: manage layer resource block lnsr
file-psd: manage layer resource block lnsr
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Plugins
git master
Other All
: Normal normal
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2015-08-23 13:13 UTC by serval2412
Modified: 2015-09-06 14:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed patch (2.75 KB, patch)
2015-09-05 20:55 UTC, serval2412
none Details | Review

Description serval2412 2015-08-23 13:13:35 UTC
With gimp sources updated today, when opening a specific psd (that I can't attach), I get this:
(file-psd:30817): file-psd-DEBUG: Process unknown layer resource block: lnsr

(Gimp launched like this:
G_MESSAGES_DEBUG=all ./gimp-beta/build/bin/gimp-2.9
)

Reading http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/, it just corresponds to "Layer name source".

I'll give it a try.
Comment 1 serval2412 2015-08-23 13:38:07 UTC
Quite confusing to get the difference between lnsr and lyid

if lyid is lyr_a->id, what use would be lyid?
Comment 2 serval2412 2015-08-23 13:38:26 UTC
I meant, what use would be lnsr
Comment 3 Michael Natterer 2015-09-04 07:34:08 UTC
I have no idea, but maybe you can cook up a patch that at least loads the
block?
Comment 4 serval2412 2015-09-04 08:19:30 UTC
About lnsr, it seems it corresponds to a the old name of the layer on 4 characters in MacRoman (it supposes to ref a lib to decode MacRoman). Nowadays name seems to be "luni". So except if we want to manage old psds, perhaps we should just ignore "lnsr".
See:
in https://github.com/layervault/psd.rb/wiki/Anatomy-of-a-PSD-File (search "layer name)
ruby code for these:
https://github.com/layervault/psd.rb/blob/master/lib/psd/layer/info/layer_name_source.rb (lnsr)
https://github.com/layervault/psd.rb/blob/master/lib/psd/layer/info/unicode_name.rb (luni)

It's quite depressing to read Anatomy-of-a-PSD-File because it seems we don't have all the specs and the existing one (https://www.adobe.com/devnet-apps/photoshop/fileformatashtml/) may be incorrect in some points :-( (see "A Little Background on Binary Files" part)

To sum up, I can propose a patch to read this part but ignore it.


Anyway, I had begun to read Adobe Specs and compare with implementation and other than Gimp implementations. I had sent you a patch for a first rework.
Comment 5 serval2412 2015-09-05 20:55:14 UTC
Created attachment 310724 [details] [review]
proposed patch

This patch is based on master from 2015-09-05 (0593eaa7c36b06e077cf1c0fceb06f204b4f5131)
Comment 6 Michael Natterer 2015-09-06 14:58:04 UTC
Thanks, pushed to master:

commit 5a2757c6ec5d6f44d74a69bc75da8bdda2585eae
Author: Julien Nabet <serval2412@yahoo.fr>
Date:   Sat Sep 5 22:46:16 2015 +0200

    Bug 753986 - manage layer resource block lnsr
    
    Layer name source (id on 4 characters encoded in MacRoman).
    psd from PS>5 have "luni" (Layer Unicode)
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=753986#c4 for more details
    
    Janitorial on lyvr:
    move IFDBG at the beginning of the function
    +change the content of it

 plug-ins/file-psd/psd-layer-res-load.c | 39 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)