Skip to content

Commit c7f98ad

Browse files
committed
Merge branch '8.8'
2 parents 9dc422c + e4cff87 commit c7f98ad

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

ChangeLog

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313
- fix for composite with many small images and some combinations of blend modes
1414
- fix memleak in tiff pyr save to memory [scossu]
1515
- istiff attempts to read the first directory rather than just testing the
16-
magic number [przemyslawpluta]
16+
magic number [przemyslawpluta]
1717
- much faster ismagick() [jcupitt]
1818
- better behaviour for vips_region_fetch() if request lies partly ouside image
1919
- remove 256 band limit in arithmetic.c [erdmann]
2020
- disable Orc if building with CET [lovell]
2121
- fix vipsthumbnail with pyr tiff [kleisauke]
2222
- text autofit could occasionally terminate early [levmorozov]
2323
- fewer warnings on tiffload [chregu]
24+
- vips_resize() breaks aspect ratio and limits shrink to prevent <1px
25+
dimensions [lovell]
2426

2527
21/9/18 started 8.8.0
2628
- much faster smartcrop [lovell]

libvips/resample/resize.c

+11
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
* 3/12/18 [edwjusti]
3232
* - disable the centre sampling offset for nearest upscale, since the
3333
* affine nearest interpolator is always centre
34+
* 7/7/19 [lovell]
35+
* - don't let either axis drop below 1px
3436
*/
3537

3638
/*
@@ -213,6 +215,11 @@ vips_resize_build( VipsObject *object )
213215
hscale *= int_hshrink;
214216
}
215217

218+
/* Don't let either axis drop below 1 px.
219+
*/
220+
hscale = VIPS_MAX( hscale, 1.0 / in->Xsize );
221+
vscale = VIPS_MAX( vscale, 1.0 / in->Ysize );
222+
216223
/* Any residual downsizing.
217224
*/
218225
if( vscale < 1.0 ) {
@@ -424,6 +431,10 @@ vips_resize_init( VipsResize *resize )
424431
* @vscale, that factor is used for the vertical scale and @scale for the
425432
* horizontal.
426433
*
434+
* If either axis would drop below 1px in size, the shrink in that dimension
435+
* is limited. This breaks the image aspect ratio, but prevents errors due to
436+
* fractional pixel sizes.
437+
*
427438
* This operation does not change xres or yres. The image resolution needs to
428439
* be updated by the application.
429440
*

po/POTFILES.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ libvips/foreign/gifload.c
186186
libvips/foreign/magick7load.c
187187
libvips/foreign/openslide2vips.c
188188
libvips/foreign/exif.c
189-
libvips/foreign/pdfload_pdfium.c
189+
libvips/foreign/pdfiumload.c
190190
libvips/foreign/fitssave.c
191191
libvips/foreign/pdfload.c
192192
libvips/foreign/magick2vips.c

0 commit comments

Comments
 (0)