Default height to VIPS_MAX_COORD for vips_thumbnail#1639
Conversation
This to prevent reduction in the vertical axis when the height is omitted. See: kleisauke/net-vips#71.
|
I'm not sure, this seems like quite a large behaviour change :-( It's likely to break a lot of downstream code. How about adding a new operation with the new behaviour? |
|
I'm also a little worried about this behavior/compatibility change. I created this PR mainly for reference purposes. I'll add the A new libvips/libvips/resample/thumbnail.c Lines 563 to 564 in 54bfa23 to VIPS_MAX_COORD instead. A new declaration which makes the width and height optional, for e.g.:
int
vips_thumbnail_axis( const char *filename, VipsImage **out, ... )Is better, but having 2 functions that can do exactly the same thing is a bit weird. Anyways, feel free to label this PR as |
|
Yes, it would be odd :( Really we'd want to replace all the
|
This to prevent reduction in the vertical axis when the height is omitted. Marked this PR as draft since it changes the behavior of
vips_thumbnailinto a resize based on a specific axis (which is more common, I think) instead than a resize based on a square bounding box.This PR resolves (partially) #709, but a better way to address that issue is to make
widthan optional parameter. This allows users to do this, for example:Instead of the current behavior:
This PR resolves kleisauke/net-vips#71 when merged.