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

Optional resizing without preservation of aspect ratio #11

Open
cmaggard opened this issue Jul 23, 2020 · 1 comment
Open

Optional resizing without preservation of aspect ratio #11

cmaggard opened this issue Jul 23, 2020 · 1 comment

Comments

@cmaggard
Copy link

Hello, first off I wanted to thank you so much for the implementation- playing around with this has been my first real stepping stone into Rust, and you've made it pretty easy!

During my tinkering, I've been trying to use some local images I had laying around, and noticed that some of them would silently fail. Namely, the ones that weren't already square. The images crate provides a resize_exact method for DynamicImage that works for resizing these in a local vendored copy of the code- do you think it would be worth adding an option to use it? If so, I could probably contribute a PR. If not, I could also contribute a PR updating the documentation to specify that only 1:1 AR images should be used. Either way, thank you!

@ryankurte
Copy link
Owner

hey thanks for the issue, i'm glad it's (mostly) working for you!

changing the default behaviour to scale non square images (rather than failing) seems like a good general improvement, though i am not sure whether this would better be accomplished via an resize_exact or a scale-to-fit (ie. does it stretch without maintaining the aspect ratio, or, fit the largest dimension while maintaining the ratio)?

perhaps we could have an enum representing scaling modes in the ImageOptions object similar to what was partially implemented in #9 for centring text.

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

2 participants