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 151686 - Photoshop text layers are not imported as text layers
Photoshop text layers are not imported as text layers
Status: RESOLVED OBSOLETE
Product: GIMP
Classification: Other
Component: Plugins
2.0.x
Other All
: Low enhancement
: 2.10
Assigned To: GIMP Bugs
GIMP Bugs
: 160564 166354 314953 529514 (view as bug list)
Depends on: 164539 448181
Blocks:
 
 
Reported: 2004-09-02 14:52 UTC by Blake Madden
Modified: 2018-05-25 09:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Adobe Photoshop 6.0 File Formats Specification Version 6.0 Release 2 (842.26 KB, application/pdf)
2006-02-08 13:06 UTC, Jon Severinsson
Details
Simple PSD file with text layer "GIMP" - PS CS5 (89.33 KB, image/vnd.adobe.photoshop)
2018-04-16 09:33 UTC, Jehan
Details
Simple PSD file with text layer "GIMP" - PS CS5 - compatibility enabled (73.95 KB, image/vnd.adobe.photoshop)
2018-04-16 09:45 UTC, Jehan
Details
Text with italic (76.05 KB, image/vnd.adobe.photoshop)
2018-04-18 10:28 UTC, Jehan
Details
Text with underline (76.82 KB, image/vnd.adobe.photoshop)
2018-04-18 10:30 UTC, Jehan
Details
And now the bold version! (76.24 KB, image/vnd.adobe.photoshop)
2018-04-28 17:28 UTC, Jehan
Details

Description Blake Madden 2004-09-02 14:52:31 UTC
When you import a PSD file that has text layers in it, note that you cannot edit
these layers.  They seem to just be seen as "regular" layers instead of text
layers and cannot be edited by the text tool.
Comment 1 Sven Neumann 2004-09-02 20:19:22 UTC
Ok, here's the deal: You get me the complete specs of PSD text layers and I will
add the code to import them as text layers.
Comment 2 Sven Neumann 2004-12-06 10:30:23 UTC
*** Bug 160564 has been marked as a duplicate of this bug. ***
Comment 3 Sven Neumann 2005-01-19 00:15:51 UTC
In order to implement this, we would also need a better text PDB API so that
plug-ins can set all text properties supported by GIMP. This is handled in bug
#164539.
Comment 4 Sven Neumann 2005-02-05 12:42:58 UTC
*** Bug 166354 has been marked as a duplicate of this bug. ***
Comment 5 Sven Neumann 2005-08-31 15:53:35 UTC
*** Bug 314953 has been marked as a duplicate of this bug. ***
Comment 6 Jon Severinsson 2006-02-08 09:53:09 UTC
You call this a feature request? I call it a text-book example on a bug!
In what way is "without instruction converting a text layer to a raster layer, and thus loosing information" not a bug?
I would even give it severity Major ("major loss of function", in this case editing text). Priority is another matter of course (it does, after all, not affect the core application), but personally I'd love to see this fixed, as it is the only thing stopping me from finally drooping Windows in WMVare...
Perhaps over-reacting a bit, but I was dismayed when I saw this bug report, and that nothing seems to be going on to rectify the problem.
Comment 7 Michael Schumacher 2006-02-08 10:09:50 UTC
So you're offering a patch for this? Attach it to this report, please.
Comment 8 Simon Budig 2006-02-08 10:27:22 UTC
Also please attach the specification of the PSD fileformat and especially how text layers are stored in it. We seem to be unable to get it. Thanks a lot.
Comment 9 Jon Severinsson 2006-02-08 13:06:39 UTC
Created attachment 58927 [details]
Adobe Photoshop 6.0 File Formats Specification Version 6.0 Release 2

Michael: I'm not blind to your irony, but unfortunately I have no patch. Though I do study computer science at university I'm no good with this low-level suff. My previous comment was intended to point out how marginalized this issue is, which imho is wrong, not to say a solution is simple.
Simon: I'm attaching the publicly available "Adobe Photoshop 6.0 File Formats Specification Version 6.0 Release 2" which should be enough to fix this bug, considering Photoshop 6.0 had full support for text layers, and later versions is supposedly compatible if you enable "Maximize Compatibility for Photoshop files".
Comment 10 Jon Severinsson 2007-06-17 18:58:15 UTC
BTW, I just found the complete Photoshop CS File Formats Specification at http://libpsd.graphest.com/download.htm
Not even a click through licence ;-)
I'm still not able to provide patches, but hopefully this might help someone who is.
Comment 11 Michael Schumacher 2007-06-18 11:14:58 UTC
I've mailed them and asked them about the license of this file. I am paranoid enough to assume that Adobe is just waiting for one of their perceived competitors to pick up the lib and then start legal action.
Comment 12 Michael Schumacher 2008-04-23 17:49:11 UTC
*** Bug 529514 has been marked as a duplicate of this bug. ***
Comment 13 techtonik 2010-03-24 17:14:49 UTC
Still not fixed in 2.6.6 - is there anybody who can change properties for this ticket, so it will popup in queries? And this certainly not an enhancement. We need at least display warning about font layer conversion.

What else besides attached font spec is required for implementation at least 6.0 format with a conversion warning about others?
Comment 14 Sven Neumann 2010-03-24 19:29:34 UTC
There's nothing wrong about the state of the bug-report as far as I can see. It is clearly an enhancement request. What's required for the implementation is a patch against the PSD import plug-in. As far as I can see the PDB API in GIMP 2.6 should be sufficient. If it isn't, then someone needs to point out what's missing.
Comment 15 techtonik 2010-03-24 21:03:43 UTC
At least version can be bumped from 2.0.x to 2.6.x 

The warning that information loss occurs when opening .PSD file with text layers should still be presented clear to users. Where it should be added?
Comment 16 Fotis A. 2010-07-23 10:24:12 UTC
Hello, i am willing to work on this bug, since it's be open for years. Are there any guidelines or any other document that will help me start the bug-fixing process??

Thanx
Comment 17 Fotis A. 2010-07-23 10:26:31 UTC
Also, i don't think this should be low priority. Thnx again
Comment 18 Michael Schumacher 2010-07-23 10:31:24 UTC
The priority doesn't matter at all, what matters is that someone is willing to work on it.

Where exactly do you start from? 

E.g. if I tell you to get and build GIMP from Git and modify the PSD import plug-in there, is this enough information to get you started?
Comment 19 Fotis A. 2010-07-23 10:40:52 UTC
Hello Michael,

i've already found the plug-in source. I just wanted to know if there is any documentation/workaround on psd file specifications to gimp
Comment 20 Sven Neumann 2010-07-25 22:41:26 UTC
The specification for the PSD file format is certainly not kept in GIMP. The GIMP plug-in API is however well documented. If you need help to locate these docs, then feel free to ask.
Comment 21 Fotis A. 2010-07-25 23:07:33 UTC
While i was searching the web to find out how this task is going to get done, i got onto this:
http://telegraphics.com.au/sw/ which contains "psdparse" an excellent psd analyzer. I think what is implemented there could easily be transfered to GIMP.

I don't quite have the time now but i will check this out next month.
Comment 22 Michael Schumacher 2010-08-12 10:52:38 UTC
BTW, the last Freely available format spec is attached to this bug.
Comment 23 Alexandre Prokoudine 2012-09-22 21:42:10 UTC
The last freely available spec is now http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
Comment 24 Jehan 2016-10-20 18:18:47 UTC
The link from Alexandre in comment 23 is still valid (and last-updated August 2016, which must mean they regularly update it).

The "Audience" section states:

> This document is provided for 3rd parties to read and write the Photoshop native file format. This document does not explain how to interpret the data. This document describes the format of the data only.

Which must mean it is OK for us to use this document for our implementation.

Considering there is a spec to follow, I set the "newcomers" keyword. This looks like a very good first contribution for someone who wants to discover the wonderful world of specifications. :-)
Comment 25 Kevin Cozens 2017-10-30 16:22:43 UTC
It would be helpful if someone with Photoshop could attach a simple file containing a text layer. When supplying the attachment add a comment stating which version of Photoshop was used to create the file. The text layer specification is different between PS4, PS5, and PS6.
Comment 26 Kevin Brubeck Unhammer 2018-04-12 08:59:30 UTC
(In reply to Kevin Cozens from comment #25)
> It would be helpful if someone with Photoshop could attach a simple file
> containing a text layer. When supplying the attachment add a comment stating
> which version of Photoshop was used to create the file. The text layer
> specification is different between PS4, PS5, and PS6.

You can get a TEMPLATE.psd from https://designaglow.com/products/design-aglow-starter-template (it's free of charge, but you'll have to make up some "payment details" because it's served through their shop). 

The version of Photoshop used to create the file is readable from the .psd, e.g. "grep -a 'Adobe Photoshop' TEMPLATE.psd" (seems that file has been created with one version and saved with others)
Comment 27 Jehan 2018-04-12 11:01:03 UTC
(In reply to Kevin Brubeck Unhammer from comment #26)
> You can get a TEMPLATE.psd from
> https://designaglow.com/products/design-aglow-starter-template (it's free of
> charge, but you'll have to make up some "payment details" because it's
> served through their shop). 

I don't know for others, but I would not give them my personal information (and even less payment info) just to download a file.
Can't you (or someone who has photoshop) just upload an empty PSD file with just a single text layer with some test text?
Comment 28 Kevin Brubeck Unhammer 2018-04-12 12:41:49 UTC
(In reply to Jehan from comment #27)
> (In reply to Kevin Brubeck Unhammer from comment #26)
> > You can get a TEMPLATE.psd from
> > https://designaglow.com/products/design-aglow-starter-template (it's free of
> > charge, but you'll have to make up some "payment details" because it's
> > served through their shop). 
> 
> I don't know for others, but I would not give them my personal information
> (and even less payment info) just to download a file.

I didn't, still got the file ;)

> Can't you (or someone who has photoshop) just upload an empty PSD file with
> just a single text layer with some test text?

I don't have it, but some quick duckgoing shows lots of example psd text layer files, eg. https://www.freepik.com/free-psd/d-photoshop-text-styles_597915.htm#term=text%20effects&page=1&position=38
Comment 29 Michael Schumacher 2018-04-12 13:15:22 UTC
The general idea was to have the person who made the file around, too, in order to be able to ask additional questions.
Comment 30 Jehan 2018-04-16 09:33:04 UTC
Created attachment 370980 [details]
Simple PSD file with text layer "GIMP" - PS CS5

On IRC, frogonia contributed the attached PSD file, from PS CS5.
It is a simple file with a text layer containing "GIMP".

The "compatibility function" has been disabled (apparently a popup when saving the file, though the contributor didn't know what it is meant to do, so maybe it doesn't matter).
Comment 31 Jehan 2018-04-16 09:45:04 UTC
Created attachment 370981 [details]
Simple PSD file with text layer "GIMP" - PS CS5 - compatibility enabled

Same file with "maximize compatibility" enabled.
drc said it is to support older versions of Photoshop, so it may be useful if ever they changed something in the test layer format.
Comment 32 Jehan 2018-04-16 13:58:53 UTC
So I had a quick look, because looking at raw formats is always fun. So getting the text contents is really easy, and the official spec explains well the format. For instance in the file from comment 30, at offset 0x49d4, what they call the "Additional Layer Information" in the spec starts for the text layer.
In there we find the text data as unicode (as a "Descriptor structure" of type "TEXT").

But the main problem is that all the styling seems to be done in a raw data "descriptor structure" (starting at offset 0x4ad5 until 0x7035).
Even though this part is not described in the spec, this would be easy enough to reverse engineer, especially since this raw data uses a lot of strings.

But while I was looking for other projects, I discover this Python library (MIT license) which already does the job (I tested it), and has the text layer support:
http://psd-tools2.readthedocs.io/en/latest/development.html

> from psd_tools import PSDImage
> psd = PSDImage.load('text_layer.psd')
> psd.layers[0].style_spans[0]

-> this returns the whole text styling (broken into spans of text), which font info, color, "FauxBold", "FauxItalic", underline, and a whole bunch of properties which we don't support yet.

I am mostly wondering if we should continue to have our own implementation of PSD decoding, considering that others seem to do the job (this library seems maintained, and has recent commits). Of course, being a Python lib means that PSD support will be dependent on whether Python option is built in GIMP. Also we'd need to make sure this lib doesn't break other features we have.

But this may make our job much easier if we start depending on a third party.

Anyway setting a 2.10 milestone because I'll want to have a closer look to this feature for a 2.10.x. I'll see then if it makes sense to port our plug-in to a third-party dep, or if I should just continue our own implementation.
Comment 33 Jehan 2018-04-16 14:21:00 UTC
This being said, the more I look at this styling stuff, the more it just looks very easy to implement text layers (well at least more or less, considering only text features we support). I will see after 2.10 release.
Comment 34 Jehan 2018-04-18 10:28:52 UTC
Created attachment 371081 [details]
Text with italic

Still by frogonia, a test of the layer with italic.
Comment 35 Jehan 2018-04-18 10:30:41 UTC
Created attachment 371082 [details]
Text with underline

And now underline!

There was also a bold version, but I reached the link too late and couldn't download it anymore.
But well… anyway I think I got the format, and these 2 additional files should be enough.
Comment 36 Jehan 2018-04-28 17:28:23 UTC
Created attachment 371497 [details]
And now the bold version!
Comment 37 GNOME Infrastructure Team 2018-05-24 11:12:39 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gimp/issues/94.