-
-
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
.resize() crops image when crop is unnecessary #831
Comments
Hello, I'm currently investigating a problem with JPEG shrink-on-load that appears to have been introduced in v0.18.0 and I believe this is related. v0.17.3 works as expected. |
@lovell ah thank you, I |
Commit 9e39a7f fixes the problem I've been investigating. Are you able to confirm the latest code on the |
...and commit f42a1ce fixes it properly, adding your test case too, thanks for reporting this. |
These fixes are in v0.18.1 now available via npm. Please re-open if you're still having related problems. |
Just checked with v0.18.1 and it works great! |
I'm having trouble with resize function cropping sides of the image when only resize is needed:
passing along width=200 produces this image:
However passing 199 or 201 produces expected result:
original:
Seems like some strange bug to me. I was expecting to always get a downscaled image in the original aspect ratio. I couldn't find anything in the documentation regarding controlling the crop. How does one achieves resizing this without cropping, and only having crop when both width and height are present?
I already tried converting to JPEG first, passing both dimensions and playing with .max, .min methods, no luck.
Running node v6.10.2, sharp v0.18.0
The text was updated successfully, but these errors were encountered: