more reliable magick error message

This commit is contained in:
John Cupitt 2018-03-11 21:51:04 +00:00
parent 08dcf29b10
commit ca5397e1d3
1 changed files with 11 additions and 5 deletions

View File

@ -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 *