diff --git a/ChangeLog b/ChangeLog index 5a9905b7..9702a107 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,7 +13,7 @@ - fix for composite with many small images and some combinations of blend modes - fix memleak in tiff pyr save to memory [scossu] - istiff attempts to read the first directory rather than just testing the -magic number [przemyslawpluta] + magic number [przemyslawpluta] - much faster ismagick() [jcupitt] - better behaviour for vips_region_fetch() if request lies partly ouside image - remove 256 band limit in arithmetic.c [erdmann] @@ -21,6 +21,8 @@ magic number [przemyslawpluta] - fix vipsthumbnail with pyr tiff [kleisauke] - text autofit could occasionally terminate early [levmorozov] - fewer warnings on tiffload [chregu] +- vips_resize() breaks aspect ratio and limits shrink to prevent <1px + dimensions [lovell] 21/9/18 started 8.8.0 - much faster smartcrop [lovell] diff --git a/libvips/resample/resize.c b/libvips/resample/resize.c index c22135ed..e99ca551 100644 --- a/libvips/resample/resize.c +++ b/libvips/resample/resize.c @@ -31,6 +31,8 @@ * 3/12/18 [edwjusti] * - disable the centre sampling offset for nearest upscale, since the * affine nearest interpolator is always centre + * 7/7/19 [lovell] + * - don't let either axis drop below 1px */ /* @@ -213,6 +215,11 @@ vips_resize_build( VipsObject *object ) hscale *= int_hshrink; } + /* Don't let either axis drop below 1 px. + */ + hscale = VIPS_MAX( hscale, 1.0 / in->Xsize ); + vscale = VIPS_MAX( vscale, 1.0 / in->Ysize ); + /* Any residual downsizing. */ if( vscale < 1.0 ) { @@ -424,6 +431,10 @@ vips_resize_init( VipsResize *resize ) * @vscale, that factor is used for the vertical scale and @scale for the * horizontal. * + * If either axis would drop below 1px in size, the shrink in that dimension + * is limited. This breaks the image aspect ratio, but prevents errors due to + * fractional pixel sizes. + * * This operation does not change xres or yres. The image resolution needs to * be updated by the application. * diff --git a/po/POTFILES.in b/po/POTFILES.in index a6b3c871..fc19cda8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -186,7 +186,7 @@ libvips/foreign/gifload.c libvips/foreign/magick7load.c libvips/foreign/openslide2vips.c libvips/foreign/exif.c -libvips/foreign/pdfload_pdfium.c +libvips/foreign/pdfiumload.c libvips/foreign/fitssave.c libvips/foreign/pdfload.c libvips/foreign/magick2vips.c