Skip to content
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

Get the document resolution (DPI --> pixel/inch) #115

Closed
joliejuke-orga opened this issue Nov 10, 2017 · 2 comments
Closed

Get the document resolution (DPI --> pixel/inch) #115

joliejuke-orga opened this issue Nov 10, 2017 · 2 comments

Comments

@joliejuke-orga
Copy link

Is it possible to get the document resolution.
I think this is an important feature since fonts size (in PT unit) should be computed from resolution.

@fabulousduck
Copy link
Collaborator

Hey @joliejuke-orga.

The root node of the document contains the Height and Width of the document with which you can calculate the resolution.

As for DPI, I have not been able to find anything about it in the official doc. So i think its safe to assume it is not stored in the file itself.

I did however find that at 0x0435 they store display data which may contain info about it.
I have not tested this yet tho as it is something i don't have time for (barely get time to answer these issues these days :( )

Regards Duck

@linkesch
Copy link
Contributor

I've run into the same issue. Official doc mentions resolution info being on 0x03ED. I created #132 pull request to extract this information following example of psd.rb.

fabulousduck added a commit that referenced this issue Mar 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants