Skip to content

Commit f257600

Browse files
committed
fix webp upscale in thumbnail
we could try to use webp shrink on load to upscale, oops see https://github.com/jcupitt/libvips/issues/710
1 parent f2c55e8 commit f257600

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

ChangeLog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
- fix transparency detection in merge, thanks Haida
33
- define env var VIPS_WARNING to hide warning messages
44
- shut down dzsave output earlier to help mark-sweep bindings
5+
- fix webp thumbnail upscale, thanks Kleis
56

67
9/6/17 started 8.5.7
78
- better smartcrop

libvips/resample/thumbnail.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,8 +254,11 @@ vips_thumbnail_open( VipsThumbnail *thumbnail )
254254
g_info( "loading PDF/SVG with factor %g pre-scale", scale );
255255
}
256256
else if( vips_isprefix( "VipsForeignLoadWebp", thumbnail->loader ) ) {
257-
shrink = vips_thumbnail_calculate_shrink( thumbnail,
258-
thumbnail->input_width, thumbnail->input_height );
257+
shrink = VIPS_MAX( 1.0,
258+
vips_thumbnail_calculate_shrink( thumbnail,
259+
thumbnail->input_width,
260+
thumbnail->input_height ) );
261+
259262
g_info( "loading webp with factor %d pre-shrink", shrink );
260263
}
261264

0 commit comments

Comments
 (0)