GNOME Bugzilla – Bug 151686
Photoshop text layers are not imported as text layers
Last modified: 2018-05-25 09:55:50 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.
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.
*** Bug 160564 has been marked as a duplicate of this bug. ***
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
*** Bug 166354 has been marked as a duplicate of this bug. ***
*** Bug 314953 has been marked as a duplicate of this bug. ***
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.
So you're offering a patch for this? Attach it to this report, please.
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.
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".
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.
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.
*** Bug 529514 has been marked as a duplicate of this bug. ***
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?
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.
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?
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??
Also, i don't think this should be low priority. Thnx again
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?
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
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.
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.
BTW, the last Freely available format spec is attached to this bug.
The last freely available spec is now http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/
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. :-)
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.
(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)
(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?
(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
The general idea was to have the person who made the file around, too, in order to be able to ask additional questions.
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).
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.
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:
> from psd_tools import PSDImage
> psd = PSDImage.load('text_layer.psd')
-> 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.
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.
Created attachment 371081 [details]
Text with italic
Still by frogonia, a test of the layer with italic.
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.
Created attachment 371497 [details]
And now the bold version!
-- 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.