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

Store TIFF DPI as integer #2078

Closed
wants to merge 2 commits into from
Closed

Store TIFF DPI as integer #2078

wants to merge 2 commits into from

Conversation

masterfool
Copy link

Fixes #2077 which prevents TIFF from being saved as JPEG with its original DPI.

Stores the TIFF DPI as integers

@arjennienhuis
Copy link
Contributor

I think it makes more sense to round when saving the image. Now you always lose precision, even when not converting the image to JPEG.

@masterfool
Copy link
Author

Good idea. I've updated the pull request.

@wiredfool
Copy link
Member

wiredfool commented Aug 17, 2016

-1

Tiff resolution is stored as a rational value and a resolution unit. See page 18/19 here: https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf

If there's an issue with jpegs, then either:

  1. The jpeg spec doesn't allow rational dpi, and we're enforcing that in a confusing way
    or
  2. We're not properly allowing a rational dpi in the jpeg save routine.

Either way, we need to dig a bit in the jpeg spec and fix the jpeg side.

@arjennienhuis
Copy link
Contributor

https://www.w3.org/Graphics/JPEG/jfif3.pdf

page 5

integer dpi or dots per cm

@wiredfool
Copy link
Member

That certainly looks like #1 is the issue, and a better way to enforce integer dpi in jpegs would do it.

@arjennienhuis
Copy link
Contributor

see #2084

@wiredfool
Copy link
Member

Closing in (eventual) favor of #2084

@wiredfool wiredfool closed this Aug 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants