From ca5397e1d353006d4308498e934db5a6045f6b08 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Sun, 11 Mar 2018 21:51:04 +0000 Subject: [PATCH] more reliable magick error message --- libvips/foreign/magick.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/libvips/foreign/magick.c b/libvips/foreign/magick.c index ecb9a50e..fde689f0 100644 --- a/libvips/foreign/magick.c +++ b/libvips/foreign/magick.c @@ -162,11 +162,17 @@ magick_inherit_exception( ExceptionInfo *exception, Image *image ) void magick_vips_error( const char *domain, ExceptionInfo *exception ) { - if( exception && - exception->reason && - exception->description ) - vips_error( domain, _( "libMagick error: %s %s" ), - exception->reason, exception->description ); + if( exception ) { + if( exception->reason && + exception->description ) + vips_error( domain, _( "libMagick error: %s %s" ), + exception->reason, exception->description ); + else if( exception->reason ) + vips_error( domain, _( "libMagick error: %s" ), + exception->reason ); + else + vips_error( domain, "%s", _( "libMagick error:" ) ); + } } static void *