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

Square images are not resized correctly #188

Closed
ecrider opened this issue Dec 25, 2022 · 2 comments
Closed

Square images are not resized correctly #188

ecrider opened this issue Dec 25, 2022 · 2 comments

Comments

@ecrider
Copy link
Contributor

ecrider commented Dec 25, 2022

Resizing perfectly square image using methods resizeToWidth(), resizeToHeight(), resizeToBestFit(), resizeToShortSide() and resizeToLongSide() is supposed to always produce image with the same width and height, but its not always the case because one of the size values is ratio scaled and then rounded down to lowest integer value via (int) cast conversion.

The easiest solution is to round scaled float value to closest integer value before type conversion. Ideally ratio scaling should be skipped completely when source width and height values are equal.

@ecrider ecrider mentioned this issue Dec 25, 2022
@ecrider
Copy link
Contributor Author

ecrider commented Dec 25, 2022

Created pull request for patch fixing the issue.

adityapatadia added a commit that referenced this issue Oct 11, 2023
@adityapatadia
Copy link
Contributor

Merged. Will release new version.

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