-
-
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
Height of the image become 0 during the resizing #2653
Comments
There should be logic to prevent this, but it's possible there are still edge cases. Please can you provide complete, standalone code and a sample input image that allows someone else to reproduce this. |
Thanks for the response. I've created a simple repository to reproduce the issue: https://github.com/jczapiewski-cksource/sharp-resize-issue. The sample code and the image are included. |
Thank you, I can reproduce this. It looks like a bug in the shrink-on-load handling that can affect very thin JPEG images where one dimension is 3 pixels or less - leave it with me. |
Commit ed5d753 fixes this and adds a test case that was previously failing. Thank you for reporting! |
Thank You! |
v0.28.2 now available with the fix for this. |
I'm trying to resize an image to given width without setting a height property for a 1px height image. Example image dimensions can be like 900px x 1px.
As a result, the following errors are thrown:
The question is, is it possible to set a minimum dimension value to avoid cases like this (eg. setting the height to 1px when the processed image is smaller)? I've found a few threads suggesting using
max
andmin
but it seems to be no longer valid nor these things are not mentioned in the documentation. I know that I can calculate the dimensions based on the buffer but I'm wondering if it is possible to handle this somehow automatically.Thanks in advance!
The text was updated successfully, but these errors were encountered: