-
-
Notifications
You must be signed in to change notification settings - Fork 654
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
Ignoring aspect ratio in vipsthumbnail #648
Comments
For implementation, perhaps the simplest way to add this is to add a new value for http://jcupitt.github.io/libvips/API/current/libvips-resample.html#VipsSize That's the thing that's set by We could add a new value, perhaps |
start experimental implementation see https://github.com/jcupitt/libvips/issues/648
OK, it seems to work. Just needs some tests.
You can't mix < > and !, it has to be just one of those modifiers, but hopefully that's OK. |
Just tested it, and it works! Awesome! 👍 I don't think there is a use case to mix those modifiers, so just one modifier is OK. Found only 1 bug in combination with |
OK, autorot seems to work. I'll add some more tests. |
Added some tests, it all seems to work. I'll leave it a day two for more testing, then merge to master. Thanks for pushing for this, @kleisauke. |
Merged to master! I'll close. Thanks for testing! |
Thanks for incorporating this in I think libvips have a time-based release cycle of 6 months (just like Ubuntu). So I guess 8.6.0 will be released in October 2017? |
Yes, it's a while off, probably. |
Sometimes it's needed to ignore the aspect ratio and distort the image so it always generates an image exactly the size specified. With imagemagick this can be done with
!
flag, see:convert terminal.gif -resize 64x64\! exact_terminal.gif
(terminal.gif can be downloaded here)
There's not yet an option to do this with
vipsthumbnail
.Background information
The resize logic from our image cache and resize proxy (which uses libvips as back-end) has much in common with the
vipsthumbnail
operator. Unfortunately, we can't use thevipsthumbnail
operator (yet) because it doesn't support ignoring the aspect ratio (which we've supported for almost 7 years now).In order to not break anyone's apps, we'll like to see that this feature is incorporated in the
vipsthumbnail
operator.How much demand is there for this feature?
I don't know the exact numbers of developers who'll like to see this feature in
vipsthumbnail
, but I think there is still some demand for it. See:lovell/sharp#118
http://stackoverflow.com/questions/42708357/resizing-stretching-with-vipsthumbnail/
To see how much demand there is for this feature, please vote with a 👍 reaction.
Number of requests
For a week, we've monitored the usage of a parameter (
&t=absolute
) to ignore the aspect ratio. A total of 7,875 uncached requests were made on 2,633 unique images (which can be seen as a small number of requests).Use case scenarios
We found out that there are some specific use case scenarios where ignoring the aspect ratio will come in handy:
X
(or to overlay over another image).Relevant links (for implementation)
lovell/sharp#192
The text was updated successfully, but these errors were encountered: