-
-
Notifications
You must be signed in to change notification settings - Fork 921
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
How are maxWidth and maxHeight supposed to work? #150
Comments
No issues with that here. I call loadImage with maxWidth=100 and maxHeight=100 and always get a thumbnail that's never larger than 100 pixels in any direction, and always proportioned in the same ratios of the original image. Can you post your code? |
Thanks for your response. I learned in the meantime that this only happens if you set |
Yes, your 3869x1024 resulting image is correct according to the code in: Not sure what the intention was by the author. As a workaround I'd probably just avoid the |
Yes, that's what I am doing right now. |
If I am calling loadImage with maxWidth = 1024, maxHeigth = 1024, I would expect that the neither the width nor the height exceed 1024. Instead, the library seems to set the shorter length to 1024, so the other can exceed its max value. Also, the library stretches the image even if it is smaller.
As an example, I have an input image that is 3560x942. The resulting image is 3869x1024, which is even bigger than the original, and the width is over 3x larger than the maxWidth.
This also happens if I set the maxHeight to 1024 only, i.e. without a maxWidth.
I would expect that maxWidth and maxHeight are maximum values, not minimum values?
The text was updated successfully, but these errors were encountered: