better error msg in magicksave

This commit is contained in:
John Cupitt 2020-04-27 17:03:18 +01:00
parent 489810989e
commit 2ad29ed09e
2 changed files with 12 additions and 3 deletions

View File

@ -287,10 +287,17 @@ int
magick_set_image_size( Image *image, const size_t width, const size_t height, magick_set_image_size( Image *image, const size_t width, const size_t height,
ExceptionInfo *exception ) ExceptionInfo *exception )
{ {
(void) exception;
#ifdef HAVE_SETIMAGEEXTENT #ifdef HAVE_SETIMAGEEXTENT
return( SetImageExtent( image, width, height ) ); int result = SetImageExtent( image, width, height );
/* IM6 sets the exception on the image.
*/
if( !result )
magick_inherit_exception( exception, image );
return( result );
#else /*!HAVE_SETIMAGEEXTENT*/ #else /*!HAVE_SETIMAGEEXTENT*/
(void) exception;
image->columns = width; image->columns = width;
image->rows = height; image->rows = height;

View File

@ -149,8 +149,10 @@ vips_foreign_save_magick_next_image( VipsForeignSaveMagick *magick )
} }
if( !magick_set_image_size( image, if( !magick_set_image_size( image,
im->Xsize, magick->page_height, magick->exception ) ) im->Xsize, magick->page_height, magick->exception ) ) {
magick_vips_error( class->nickname, magick->exception );
return( -1 ); return( -1 );
}
/* Delay must be converted from milliseconds into centiseconds /* Delay must be converted from milliseconds into centiseconds
* as GIF image requires centiseconds. * as GIF image requires centiseconds.