-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
text rectangles are incorrect #78
Comments
BTW - this is a "paragraph text" layer NOT a "point text" layer. It seems like psd.rb is treating the object as point text even if its paragraph text. I am pretty sure things work fine if its point text. |
Digging around in this I discovered this perhaps related discrepancy: Adobe spec says that the "left, top, right, bottom" info are all 8 byte values, the parser is reading these as ints (which are too short and wrong type.) Compare for example the transform values. But its not that simple: patching the code to read left/top/right/bottom as double gives really strange values. I am using this document as reference: http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/#50577411_21585 spec might be wrong, as every place else where a rect is specified its done with 4 byte values, not 8. |
According to the PSD you gave me, the folder is named "text" but the actual text layer is named "Craig & Tessa". Are you looking at the correct position data? |
Yes I was giving the folder name, but the folder only contains the single layer, so the story is the same. Sorry about that. |
This seems extremely cludgy and brittle, but you can extract the correct dimensions (at least for simple cases) as follows:
This only seems to work if |
I'm also facing the same issue. Can anybody provide the solution for this? Thanks in advance. |
We still use this exact same hack. |
Below logic given me the exact values for me.
Thanks. |
I have a simple test registration document.
It contains a single text field called "text"
the dimensions and of the text in the document are much different from the original PSD, and from what is rendered.
The dimensions in the psd (viewed on a photoshop) are top = 1", left = 1", width=3", height=1"
The doc is 300 DPI, but the dimensions as read by psd.rb are top = 308, left = 464, width = 592, height = 101. (should be 300, 300, 900, 300)
For comparison the document has a grey image layer under the text with the same position and dimensions.
The photo layer position and dimensions ARE reported correctly by psd.rb.
My guess is that psd.rb is giving back some kind of minimal bounding box for the text, not the actual text rect in the psd file.
However as the psd file actually knows, and remembers the complete size of the text rect this looks like a problem.
The file can be accessed here: (I hope) http://832069e906a4cb1cbeba-356812981dd62c6b48c695351cd5444e.r90.cf2.rackcdn.com/uploads/background/psd/35/ce452152-cba1-4ca8-ade2-7d6d6e24c1e820141027-2-jzu8rh
The text was updated successfully, but these errors were encountered: