From 17cddc196b9c6e24fba7dd9594da9f9ecade08cb Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Thu, 23 Jul 2020 15:41:20 +0100 Subject: [PATCH] improve pngload error messages too see https://github.com/libvips/libvips/issues/1578 --- libvips/foreign/vipspng.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index bc09b256..78dd2585 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -714,8 +714,11 @@ vips__png_header_source( VipsSource *source, VipsImage *out ) Read *read; if( !(read = read_new( source, out, TRUE )) || - png2vips_header( read, out ) ) + png2vips_header( read, out ) ) { + vips_error( "png2vips", _( "unable to read source %s" ), + vips_connection_nick( VIPS_CONNECTION( source ) ) ); return( -1 ); + } vips_source_minimise( source ); @@ -729,8 +732,11 @@ vips__png_read_source( VipsSource *source, VipsImage *out, gboolean fail ) if( !(read = read_new( source, out, fail )) || png2vips_image( read, out ) || - vips_source_decode( source ) ) + vips_source_decode( source ) ) { + vips_error( "png2vips", _( "unable to read source %s" ), + vips_connection_nick( VIPS_CONNECTION( source ) ) ); return( -1 ); + } return( 0 ); }