Incorporate #2506 also in {webp,magick7}load (#2507)

This commit is contained in:
Kleis Auke Wolthuizen 2021-11-01 19:33:27 +01:00 committed by GitHub
parent 9c1003fbe6
commit f92069b035
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -601,7 +601,7 @@ vips_foreign_load_magick7_parse( VipsForeignLoadMagick7 *magick7,
/* So we can finally set the height.
*/
if( vips_object_argument_isset( VIPS_OBJECT( magick7 ), "n" ) ) {
if( read->n_frames > 1 ) {
vips_image_set_int( out, VIPS_META_PAGE_HEIGHT, out->Ysize );
out->Ysize *= magick7->n_frames;
}

View File

@ -519,8 +519,12 @@ read_header( Read *read, VipsImage *out )
#endif /*DEBUG*/
if( flags & ANIMATION_FLAG ) {
vips_image_set_int( out,
VIPS_META_PAGE_HEIGHT, read->frame_height );
/* Only set page-height if we have more than one page, or
* this could accidentally turn into an animated image later.
*/
if( read->n > 1 )
vips_image_set_int( out,
VIPS_META_PAGE_HEIGHT, read->frame_height );
read->width = read->frame_width;
read->height = read->n * read->frame_height;