From c85dd26627572fad3721e406858de610e009ea4a Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 10 Jun 2014 13:46:05 +0100 Subject: [PATCH] oops, better filename set on foreign load we were setting the filename in the wrong place --- TODO | 9 +++++++++ libvips/foreign/analyze2vips.c | 2 -- libvips/foreign/analyzeload.c | 2 ++ libvips/foreign/csv.c | 3 --- libvips/foreign/csvload.c | 2 ++ libvips/foreign/fits.c | 1 - libvips/foreign/fitsload.c | 2 ++ libvips/foreign/jpeg2vips.c | 1 - libvips/foreign/jpegload.c | 2 ++ libvips/foreign/magick2vips.c | 1 - libvips/foreign/magickload.c | 2 ++ libvips/foreign/matlab.c | 1 - libvips/foreign/matload.c | 2 ++ libvips/foreign/matrixload.c | 2 ++ libvips/foreign/openexr2vips.c | 1 - libvips/foreign/openexrload.c | 2 ++ libvips/foreign/openslide2vips.c | 1 - libvips/foreign/openslideload.c | 2 ++ libvips/foreign/pngload.c | 2 ++ libvips/foreign/ppm.c | 4 ---- libvips/foreign/ppmload.c | 2 ++ libvips/foreign/radiance.c | 1 - libvips/foreign/radload.c | 2 ++ libvips/foreign/tiff2vips.c | 1 - libvips/foreign/tiffload.c | 2 ++ libvips/foreign/vipspng.c | 1 - libvips/foreign/webp2vips.c | 4 ---- libvips/foreign/webpload.c | 4 ++++ 28 files changed, 39 insertions(+), 22 deletions(-) diff --git a/TODO b/TODO index 0f9a9b91..4ed93e38 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,12 @@ +- ban libgsf-1 1.14.26 and earlier + +- mark VipsForeign and VipsWrap7 as deprecated, if they're not + + don't display them in vips list classes + + + + - can we use postbuild elsewhere? look at use of "preclose" / "written", etc. diff --git a/libvips/foreign/analyze2vips.c b/libvips/foreign/analyze2vips.c index eee0eebc..6413f79f 100644 --- a/libvips/foreign/analyze2vips.c +++ b/libvips/foreign/analyze2vips.c @@ -591,8 +591,6 @@ vips__analyze_read( const char *filename, VipsImage *out ) } g_object_unref( x ); - VIPS_SETSTR( out->filename, filename ); - return( 0 ); } diff --git a/libvips/foreign/analyzeload.c b/libvips/foreign/analyzeload.c index dbd355bb..37cc68d7 100644 --- a/libvips/foreign/analyzeload.c +++ b/libvips/foreign/analyzeload.c @@ -84,6 +84,8 @@ vips_foreign_load_analyze_header( VipsForeignLoad *load ) if( vips__analyze_read_header( analyze->filename, load->out ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, analyze->filename ); + return( 0 ); } diff --git a/libvips/foreign/csv.c b/libvips/foreign/csv.c index 859985f0..dfee788b 100644 --- a/libvips/foreign/csv.c +++ b/libvips/foreign/csv.c @@ -348,7 +348,6 @@ vips__csv_read( const char *filename, VipsImage *out, return( -1 ); } fclose( fp ); - VIPS_SETSTR( out->filename, filename ); return( 0 ); } @@ -366,7 +365,6 @@ vips__csv_read_header( const char *filename, VipsImage *out, return( -1 ); } fclose( fp ); - VIPS_SETSTR( out->filename, filename ); return( 0 ); } @@ -708,7 +706,6 @@ vips__matrix_read( const char *filename ) return( NULL ); out = vips__matrix_read_file( fp ); fclose( fp ); - VIPS_SETSTR( out->filename, filename ); return( out ); } diff --git a/libvips/foreign/csvload.c b/libvips/foreign/csvload.c index 94d82895..9492f6a4 100644 --- a/libvips/foreign/csvload.c +++ b/libvips/foreign/csvload.c @@ -92,6 +92,8 @@ vips_foreign_load_csv_header( VipsForeignLoad *load ) csv->skip, csv->lines, csv->whitespace, csv->separator ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, csv->filename ); + return( 0 ); } diff --git a/libvips/foreign/fits.c b/libvips/foreign/fits.c index 066bdd60..4a0a56e7 100644 --- a/libvips/foreign/fits.c +++ b/libvips/foreign/fits.c @@ -168,7 +168,6 @@ vips_fits_new_read( const char *filename, VipsImage *out, int band_select ) return( NULL ); fits->filename = vips_strdup( NULL, filename ); - VIPS_SETSTR( out->filename, filename ); fits->image = out; fits->fptr = NULL; fits->lock = NULL; diff --git a/libvips/foreign/fitsload.c b/libvips/foreign/fitsload.c index 338e4458..678d1947 100644 --- a/libvips/foreign/fitsload.c +++ b/libvips/foreign/fitsload.c @@ -74,6 +74,8 @@ vips_foreign_load_fits_header( VipsForeignLoad *load ) if( vips__fits_read_header( fits->filename, load->out ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, fits->filename ); + return( 0 ); } diff --git a/libvips/foreign/jpeg2vips.c b/libvips/foreign/jpeg2vips.c index 771b2340..2483de3c 100644 --- a/libvips/foreign/jpeg2vips.c +++ b/libvips/foreign/jpeg2vips.c @@ -250,7 +250,6 @@ static int readjpeg_file( ReadJpeg *jpeg, const char *filename ) { jpeg->filename = g_strdup( filename ); - VIPS_SETSTR( jpeg->out->filename, filename ); if( !(jpeg->eman.fp = vips__file_open_read( filename, NULL, FALSE )) ) return( -1 ); jpeg_stdio_src( &jpeg->cinfo, jpeg->eman.fp ); diff --git a/libvips/foreign/jpegload.c b/libvips/foreign/jpegload.c index 7c9c1609..6f9e3d3a 100644 --- a/libvips/foreign/jpegload.c +++ b/libvips/foreign/jpegload.c @@ -192,6 +192,8 @@ vips_foreign_load_jpeg_file_header( VipsForeignLoad *load ) TRUE, jpeg->shrink, jpeg->fail, FALSE ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, file->filename ); + return( 0 ); } diff --git a/libvips/foreign/magick2vips.c b/libvips/foreign/magick2vips.c index 24e64e03..f64d35f8 100644 --- a/libvips/foreign/magick2vips.c +++ b/libvips/foreign/magick2vips.c @@ -158,7 +158,6 @@ read_new( const char *filename, VipsImage *im, gboolean all_frames ) if( !(read = VIPS_NEW( im, Read )) ) return( NULL ); read->filename = g_strdup( filename ); - VIPS_SETSTR( im->filename, filename ); read->all_frames = all_frames; read->im = im; read->image = NULL; diff --git a/libvips/foreign/magickload.c b/libvips/foreign/magickload.c index 5d9b1484..1672bbb2 100644 --- a/libvips/foreign/magickload.c +++ b/libvips/foreign/magickload.c @@ -116,6 +116,8 @@ vips_foreign_load_magick_header( VipsForeignLoad *load ) load->out, magick->all_frames ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, magick->filename ); + return( 0 ); } diff --git a/libvips/foreign/matlab.c b/libvips/foreign/matlab.c index 1e7ab3f0..fce0b5ee 100644 --- a/libvips/foreign/matlab.c +++ b/libvips/foreign/matlab.c @@ -99,7 +99,6 @@ read_new( const char *filename, VipsImage *out ) return( NULL ); read->filename = vips_strdup( NULL, filename ); - VIPS_SETSTR( out->filename, filename ); read->out = out; read->mat = NULL; read->var = NULL; diff --git a/libvips/foreign/matload.c b/libvips/foreign/matload.c index c066b110..2101ccde 100644 --- a/libvips/foreign/matload.c +++ b/libvips/foreign/matload.c @@ -90,6 +90,8 @@ vips_foreign_load_mat_header( VipsForeignLoad *load ) if( vips__mat_header( mat->filename, load->out ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, mat->filename ); + return( 0 ); } diff --git a/libvips/foreign/matrixload.c b/libvips/foreign/matrixload.c index 65a0dff1..254be289 100644 --- a/libvips/foreign/matrixload.c +++ b/libvips/foreign/matrixload.c @@ -99,6 +99,8 @@ vips_foreign_load_matrix_header( VipsForeignLoad *load ) vips_image_set_double( load->out, "scale", scale ); vips_image_set_double( load->out, "offset", offset ); + VIPS_SETSTR( load->out->filename, matrix->filename ); + return( 0 ); } diff --git a/libvips/foreign/openexr2vips.c b/libvips/foreign/openexr2vips.c index db7e2401..c6a13f53 100644 --- a/libvips/foreign/openexr2vips.c +++ b/libvips/foreign/openexr2vips.c @@ -137,7 +137,6 @@ read_new( const char *filename, VipsImage *out ) if( !(read = VIPS_NEW( NULL, Read )) ) return( NULL ); read->filename = vips_strdup( NULL, filename ); - VIPS_SETSTR( out->filename, filename ); read->out = out; read->tiles = NULL; read->lines = NULL; diff --git a/libvips/foreign/openexrload.c b/libvips/foreign/openexrload.c index 694d4182..94f147d7 100644 --- a/libvips/foreign/openexrload.c +++ b/libvips/foreign/openexrload.c @@ -95,6 +95,8 @@ vips_foreign_load_openexr_header( VipsForeignLoad *load ) if( vips__openexr_read_header( openexr->filename, load->out ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, openexr->filename ); + return( 0 ); } diff --git a/libvips/foreign/openslide2vips.c b/libvips/foreign/openslide2vips.c index 5aae7cbf..b3e61918 100644 --- a/libvips/foreign/openslide2vips.c +++ b/libvips/foreign/openslide2vips.c @@ -285,7 +285,6 @@ readslide_new( const char *filename, VipsImage *out, vips_image_init_fields( out, w, h, 4, VIPS_FORMAT_UCHAR, VIPS_CODING_NONE, VIPS_INTERPRETATION_RGB, 1.0, 1.0 ); - VIPS_SETSTR( out->filename, filename ); for( properties = openslide_get_property_names( rslide->osr ); *properties != NULL; properties++ ) diff --git a/libvips/foreign/openslideload.c b/libvips/foreign/openslideload.c index dc44d037..cfef1ccb 100644 --- a/libvips/foreign/openslideload.c +++ b/libvips/foreign/openslideload.c @@ -112,6 +112,8 @@ vips_foreign_load_openslide_header( VipsForeignLoad *load ) openslide->level, openslide->associated ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, openslide->filename ); + return( 0 ); } diff --git a/libvips/foreign/pngload.c b/libvips/foreign/pngload.c index 2d1ba065..bd855d65 100644 --- a/libvips/foreign/pngload.c +++ b/libvips/foreign/pngload.c @@ -96,6 +96,8 @@ vips_foreign_load_png_header( VipsForeignLoad *load ) if( vips__png_header( png->filename, load->out ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, png->filename ); + return( 0 ); } diff --git a/libvips/foreign/ppm.c b/libvips/foreign/ppm.c index 85177389..c3ed3073 100644 --- a/libvips/foreign/ppm.c +++ b/libvips/foreign/ppm.c @@ -445,8 +445,6 @@ vips__ppm_header( const char *filename, VipsImage *out ) fclose( fp ); - VIPS_SETSTR( out->filename, filename ); - return( 0 ); } @@ -495,8 +493,6 @@ vips__ppm_load( const char *filename, VipsImage *out ) fclose( fp ); - VIPS_SETSTR( out->filename, filename ); - return( 0 ); } diff --git a/libvips/foreign/ppmload.c b/libvips/foreign/ppmload.c index ef610f24..81accecc 100644 --- a/libvips/foreign/ppmload.c +++ b/libvips/foreign/ppmload.c @@ -86,6 +86,8 @@ vips_foreign_load_ppm_header( VipsForeignLoad *load ) if( vips__ppm_header( ppm->filename, load->out ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, ppm->filename ); + return( 0 ); } diff --git a/libvips/foreign/radiance.c b/libvips/foreign/radiance.c index 1f07ad5b..d52e0ab8 100644 --- a/libvips/foreign/radiance.c +++ b/libvips/foreign/radiance.c @@ -925,7 +925,6 @@ read_new( const char *filename, VipsImage *out ) return( NULL ); read->filename = vips_strdup( NULL, filename ); - VIPS_SETSTR( out->filename, filename ); read->out = out; read->fin = NULL; strcpy( read->format, COLRFMT ); diff --git a/libvips/foreign/radload.c b/libvips/foreign/radload.c index 46c9299f..bfaba384 100644 --- a/libvips/foreign/radload.c +++ b/libvips/foreign/radload.c @@ -88,6 +88,8 @@ vips_foreign_load_rad_header( VipsForeignLoad *load ) if( vips__rad_header( rad->filename, load->out ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, rad->filename ); + return( 0 ); } diff --git a/libvips/foreign/tiff2vips.c b/libvips/foreign/tiff2vips.c index d5dc339f..dfbd2703 100644 --- a/libvips/foreign/tiff2vips.c +++ b/libvips/foreign/tiff2vips.c @@ -1691,7 +1691,6 @@ readtiff_new_filename( const char *filename, VipsImage *out, int page, return( NULL ); rtiff->filename = vips_strdup( VIPS_OBJECT( out ), filename ); - VIPS_SETSTR( out->filename, filename ); /* No mmap --- no performance advantage with libtiff, and it burns up * our VM if the tiff file is large. diff --git a/libvips/foreign/tiffload.c b/libvips/foreign/tiffload.c index a5c19b95..c453d1a3 100644 --- a/libvips/foreign/tiffload.c +++ b/libvips/foreign/tiffload.c @@ -145,6 +145,8 @@ vips_foreign_load_tiff_file_header( VipsForeignLoad *load ) if( vips__tiff_read_header( file->filename, load->out, tiff->page ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, file->filename ); + return( 0 ); } diff --git a/libvips/foreign/vipspng.c b/libvips/foreign/vipspng.c index cb295e94..960bf4c5 100644 --- a/libvips/foreign/vipspng.c +++ b/libvips/foreign/vipspng.c @@ -202,7 +202,6 @@ read_new_filename( VipsImage *out, const char *name, gboolean readbehind ) return( NULL ); read->name = vips_strdup( VIPS_OBJECT( out ), name ); - VIPS_SETSTR( out->filename, name ); if( !(read->fp = vips__file_open_read( name, NULL, FALSE )) ) return( NULL ); diff --git a/libvips/foreign/webp2vips.c b/libvips/foreign/webp2vips.c index 6faae32b..5fde4622 100644 --- a/libvips/foreign/webp2vips.c +++ b/libvips/foreign/webp2vips.c @@ -207,8 +207,6 @@ vips__webp_read_file_header( const char *filename, VipsImage *out ) read_free( read ); - VIPS_SETSTR( out->filename, filename ); - return( 0 ); } @@ -264,8 +262,6 @@ vips__webp_read_file( const char *filename, VipsImage *out ) read_free( read ); - VIPS_SETSTR( out->filename, filename ); - return( 0 ); } diff --git a/libvips/foreign/webpload.c b/libvips/foreign/webpload.c index 9dd79249..51ed3db6 100644 --- a/libvips/foreign/webpload.c +++ b/libvips/foreign/webpload.c @@ -43,6 +43,8 @@ #ifdef HAVE_LIBWEBP +#include + #include #include "webp.h" @@ -130,6 +132,8 @@ vips_foreign_load_webp_file_header( VipsForeignLoad *load ) if( vips__webp_read_file_header( file->filename, load->out ) ) return( -1 ); + VIPS_SETSTR( load->out->filename, file->filename ); + return( 0 ); }