-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
vips_thumbnail fails when the target dimensions are bigger than the original, it is supposed to crop and only downsize #2157
Comments
thumbnail could fail for small images if upsize was disallowed and crop was enabled, thanks Andrewsville see #2157
Hi @Andrewsville, ooops, I'm so sorry, this dropped off my todo list. I've fixed this in master so it does your 2. above and this improvement should be in 8.12. Thank you very much for the idea! |
Just encountered this myself, so thanks for the fix! Do you have a rough idea of when to expect 8.12? [edit] So in my case I actually had this problem with a pdf. It seems vips (or poppler) is loading the pdf at a relatively low DPI and has decided that its "size" is smaller than the thumbnail I requested and then fails, which doesn't really make sense. |
8.12 should be fairly soon now. We're still tinkering with a new GIF saver, but when that's done it should be ready. |
Cool, thanks. Should I make a new issue regarding the pdf dpi? |
Sure! If you have a sample image and way to make vipsthumbnail misbehave, we'd love to see it. |
Bug report
vips_thubmnail
fails under specific circumstances with a not very clear error messagesmartcrop: bad extract area
:crop != VIPS_INTERESTING_NONE
meaning the image should be cropped to fill the whole thumbnail.size == VIPS_SIZE_DOWN
meaning the original image should only be downscaled, if necessary.To Reproduce
vips thumbnail original.jpeg thumb.jpg 400 --height 200 --size down --crop entropy
smartcrop: bad extract area
Expected behavior
This combination of parameters and input image obviously means that
vips_thubmnail
cannot (completely) do what it is asked to - the image is not big enough to fill the thumbnail dimensions and vips cannot upscale it. This means that there are IMO two solutions:Actual behavior
vips_thubmnail
fails with a not very clear error messagesmartcrop: bad extract area
probably because it calculates coordinates out of the image bounds.A simple workaround for the moment is to set the thumbnail dimensions to
min(original_dimension, requested_dimension)
making it do the suggested solution 2 from above.Environment
Ubuntu Groovy with distribution vips:
as well as compiled from the latest 8.10.6-beta2 relase:
The text was updated successfully, but these errors were encountered: