From 7906c128cd0127b5fde47c06c1b10945c1d965a3 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 18 Dec 2019 17:50:19 +0000 Subject: [PATCH] better error messages on save The stream savers were polluting the error log. --- libvips/iofuncs/image.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libvips/iofuncs/image.c b/libvips/iofuncs/image.c index 3d41f19d..e8fdec3c 100644 --- a/libvips/iofuncs/image.c +++ b/libvips/iofuncs/image.c @@ -2710,10 +2710,16 @@ vips_image_write_to_file( VipsImage *image, const char *name, ... ) /* Save with the new stream API if we can. Fall back to the older * mechanism in case the loader we need has not been converted yet. + * + * We need to hide any errors from this first phase. */ vips__filename_split8( name, filename, option_string ); - if( (operation_name = vips_foreign_find_save_stream( filename )) ) { + vips_error_freeze(); + operation_name = vips_foreign_find_save_stream( filename ); + vips_error_thaw(); + + if( operation_name ) { VipsStreamo *streamo; if( !(streamo = vips_streamo_new_to_file( filename )) )