From 58439e31fb269f19669c0213cef95cff033e6088 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 29 Feb 2012 13:49:48 +0000 Subject: [PATCH] fix filename display in "header" and friends --- ChangeLog | 3 +++ TODO | 2 ++ libvips/deprecated/lazy.c | 12 ++++++++++-- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46a44251..7595660a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ - new vips_sink_memory() keeps read ordering - tiff, jpeg, png readers support sequential read - max/min avoid NaN +- oop, histnorm was broken by the new vipsstats +- never use IM ping to get a header, fixes BMP load +- set @filename for non-vips formats in vips7 compat layer 20/8/11 started 7.27.0 - version bump for new dev cycle diff --git a/TODO b/TODO index 99eb5d31..ac8bf3a7 100644 --- a/TODO +++ b/TODO @@ -9,6 +9,8 @@ mosaic - balance should use new meta stuff +- histogram balance option? + resample ======== diff --git a/libvips/deprecated/lazy.c b/libvips/deprecated/lazy.c index a2e9283d..af2595a1 100644 --- a/libvips/deprecated/lazy.c +++ b/libvips/deprecated/lazy.c @@ -292,9 +292,17 @@ vips__deprecated_open_read( const char *filename ) */ IMAGE *image; - if( !(image = vips_image_new()) || - vips_image_open_lazy( image, format, filename, TRUE ) ) + image = vips_image_new(); + if( vips_image_open_lazy( image, format, filename, TRUE ) ) { + g_object_unref( image ); return( NULL ); + } + + /* Yuk. Can't g_object_set() filename since it's after + * construct. Just zap the new filename in. + */ + VIPS_FREE( image->filename ); + image->filename = g_strdup( filename ); return( image ); }