-
Notifications
You must be signed in to change notification settings - Fork 671
Allow setting a custom pixel density in the JPEG encoder #1078
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
Conversation
The encoder used to hardcode a pixel aspect ratio of 1x1 It allows setting a custom DPI value. Fixes image-rs#1077
|
It might be good to have the pixel density setting be part of the ImageEncoder trait that @aschampion is looking into adding for #1076 |
|
@fintelia : do you want to wait until ImageEncoder is merged, and then re-do this PR against the new trait ? Or can we merge this one first, and then let the ImageEncoder PR use that ? |
|
Also: Do you think it would be a good idea to reuse the types defined in image-rs/jpeg-decoder#115 once it is merged ? |
Many of the format encoders' constructors and parameters are similar, so it might eventually make sense to make some common subset of these or other settings part of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than changing the return type, I think it is worth going ahead and merging these changes. Longer term, I'd like to have more consistent interfaces for decoders (and probably merge jpeg encoding and decoding into the same crate) but we shouldn't let that delay progress now. We're still not really close to 1.0 so we are free to make breaking changes as needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll merge this once CI finishes
|
Thank you ! |
This pull request allows setting a custom DPI value for JPEG images (the encoder used to hardcode a pixel aspect ratio of 1x1 for all images).
Fixes #1077
I license past and future contributions under the dual MIT/Apache-2.0 license,
allowing licensees to chose either at their option.