From 2e3eca7e292270c1055e3ba38a34e2877f9ad1dd Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 29 Jan 2020 15:44:55 +0000 Subject: [PATCH] another missing copy operation The --page-height arg to savers needs a copy as well. --- libvips/foreign/foreign.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libvips/foreign/foreign.c b/libvips/foreign/foreign.c index aec3337a..d59016ce 100644 --- a/libvips/foreign/foreign.c +++ b/libvips/foreign/foreign.c @@ -1640,9 +1640,19 @@ vips_foreign_save_build( VipsObject *object ) save->background ) ) return( -1 ); - if( save->page_height ) + if( save->page_height ) { + VipsImage *x; + + if( vips_copy( ready, &x, NULL ) ) { + VIPS_UNREF( ready ); + return( -1 ); + } + VIPS_UNREF( ready ); + ready = x; + vips_image_set_int( ready, VIPS_META_PAGE_HEIGHT, save->page_height ); + } VIPS_UNREF( save->ready ); save->ready = ready;