-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Output density inconsistent #2455
Comments
For context, I discovered this converting files to PDFs, where pixel density is an important value to read |
The test files are from all over the place so it doesn't surprise me that the density metadata is too :) PNG images use the rather unusual pixels per metre as their integer units for this, hence the rounding errors when converting to DPI - see https://www.cocoanetics.com/2013/02/72-009-dpi/ Please see #967 for a future possible enhancement to allow setting the xres and yres. |
Thank you for the quick answer! Why is it though that png outputs as 28.35 DPI and JPG as 72.009 DPI? Shouldn't both be 72 DPI (or as close as JPG is)? This could also be an imagemagick issue of course. If all file formats reliably output 72 DPI (or as close as JPG is) that would solve this for me for now. I saw the linked issue as well, and would be happy to contribute once we need to output custom DPI :) |
Been a while but I did a quick check and the ImageMagick |
perfect, no that works. Thank you for explaining! |
I'm debugging an issue where png output density isn't 72, and noticed that the expected densities are all over the place:
Maybe these files weren't generated with
sharp
, so I did a simple check:If you change the output format to
jpg
, it's basically 72x72:I wonder where these numbers are coming from. This is on git master.
The text was updated successfully, but these errors were encountered: