don't set page-height in thumbnail unless we must
We were always setting page-height in thumbnail, even on single-frame images. This could cause problems if the image height was later increased by a factor of the height -- non-animated images could accidentally turn into animated images. https://github.com/libvips/libvips/issues/1469
This commit is contained in:
parent
0cdf00a9ba
commit
5b09845bd5
@ -677,8 +677,13 @@ vips_thumbnail_build( VipsObject *object )
|
|||||||
return( -1 );
|
return( -1 );
|
||||||
in = t[13];
|
in = t[13];
|
||||||
output_page_height = VIPS_RINT( preshrunk_page_height / vshrink );
|
output_page_height = VIPS_RINT( preshrunk_page_height / vshrink );
|
||||||
vips_image_set_int( in,
|
|
||||||
VIPS_META_PAGE_HEIGHT, output_page_height );
|
/* Only set page-height if we have more than one page, or this could
|
||||||
|
* accidentally turn into an animated image later.
|
||||||
|
*/
|
||||||
|
if( thumbnail->n_loaded_pages > 1 )
|
||||||
|
vips_image_set_int( in,
|
||||||
|
VIPS_META_PAGE_HEIGHT, output_page_height );
|
||||||
|
|
||||||
if( have_premultiplied ) {
|
if( have_premultiplied ) {
|
||||||
g_info( "unpremultiplying alpha" );
|
g_info( "unpremultiplying alpha" );
|
||||||
|
Loading…
Reference in New Issue
Block a user