Set page height only for multi-page images (#2506)
This commit is contained in:
parent
e412d5bdf0
commit
9c1003fbe6
@ -605,8 +605,12 @@ vips_foreign_load_heif_set_header( VipsForeignLoadHeif *heif, VipsImage *out )
|
||||
#endif /*HAVE_HEIF_COLOR_PROFILE*/
|
||||
|
||||
vips_image_set_int( out, "heif-primary", heif->primary_page );
|
||||
vips_image_set_int( out, "n-pages", heif->n_top );
|
||||
if( vips_object_argument_isset( VIPS_OBJECT( heif ), "n" ) )
|
||||
vips_image_set_int( out, VIPS_META_N_PAGES, heif->n_top );
|
||||
|
||||
/* Only set page-height if we have more than one page, or this could
|
||||
* accidentally turn into an animated image later.
|
||||
*/
|
||||
if( heif->n > 1 )
|
||||
vips_image_set_int( out,
|
||||
VIPS_META_PAGE_HEIGHT, heif->page_height );
|
||||
|
||||
|
@ -299,7 +299,10 @@ vips_foreign_load_nsgif_set_header( VipsForeignLoadNsgif *gif,
|
||||
VIPS_INTERPRETATION_sRGB, 1.0, 1.0 );
|
||||
vips_image_pipelinev( image, VIPS_DEMAND_STYLE_FATSTRIP, NULL );
|
||||
|
||||
if( vips_object_argument_isset( VIPS_OBJECT( gif ), "n" ) )
|
||||
/* Only set page-height if we have more than one page, or this could
|
||||
* accidentally turn into an animated image later.
|
||||
*/
|
||||
if( gif->n > 1 )
|
||||
vips_image_set_int( image,
|
||||
VIPS_META_PAGE_HEIGHT, gif->anim->height );
|
||||
vips_image_set_int( image, VIPS_META_N_PAGES,
|
||||
|
@ -488,7 +488,11 @@ vips_foreign_load_pdf_header( VipsForeignLoad *load )
|
||||
for( i = 1; i < pdf->n; i++ )
|
||||
if( pdf->pages[i].height != pdf->pages[0].height )
|
||||
break;
|
||||
if( vips_object_argument_isset( VIPS_OBJECT( pdf ), "n" ) )
|
||||
|
||||
/* Only set page-height if we have more than one page, or this could
|
||||
* accidentally turn into an animated image later.
|
||||
*/
|
||||
if( pdf->n > 1 )
|
||||
vips_image_set_int( load->out,
|
||||
VIPS_META_PAGE_HEIGHT, pdf->pages[0].height );
|
||||
|
||||
|
@ -361,7 +361,11 @@ vips_foreign_load_pdf_header( VipsForeignLoad *load )
|
||||
for( i = 1; i < pdf->n; i++ )
|
||||
if( pdf->pages[i].height != pdf->pages[0].height )
|
||||
break;
|
||||
if( vips_object_argument_isset( VIPS_OBJECT( pdf ), "n" ) )
|
||||
|
||||
/* Only set page-height if we have more than one page, or this could
|
||||
* accidentally turn into an animated image later.
|
||||
*/
|
||||
if( pdf->n > 1 )
|
||||
vips_image_set_int( load->out,
|
||||
VIPS_META_PAGE_HEIGHT, pdf->pages[0].height );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user