From db2c4f572ad53ce054d0ca022b50d3f15dde25e0 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 16 Jul 2012 15:27:16 +0100 Subject: [PATCH 1/6] png compression range was wrong png compression range was locked to 1-10, should have been 0-9 --- libvips/foreign/pngsave.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libvips/foreign/pngsave.c b/libvips/foreign/pngsave.c index 1979a7a8..53eacaac 100644 --- a/libvips/foreign/pngsave.c +++ b/libvips/foreign/pngsave.c @@ -2,6 +2,8 @@ * * 2/12/11 * - wrap a class around the png writer + * 16/7/12 + * - compression should be 0-9, not 1-10 */ /* @@ -104,7 +106,7 @@ vips_foreign_save_png_class_init( VipsForeignSavePngClass *class ) _( "Compression factor" ), VIPS_ARGUMENT_OPTIONAL_INPUT, G_STRUCT_OFFSET( VipsForeignSavePng, compression ), - 1, 10, 6 ); + 0, 9, 6 ); VIPS_ARG_BOOL( class, "interlace", 7, _( "Interlace" ), From 5363aace3910f569baa61ca956df38bccc13244e Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 17 Jul 2012 09:46:16 +0100 Subject: [PATCH 2/6] wopconst was wrong struct offset astray meant that wopconst didn't work --- ChangeLog | 6 ++++++ configure.in | 6 +++--- libvips/arithmetic/math2.c | 4 +++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index adecf896..2804fe1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +16/7/12 started 7.28.10 +- wopconst was broken +- vips_sign() was broken +- png save compression range was wrong +- more/moreeq was wrong + 18/6/12 started 7.28.9 - slightly more memory debugging output - remove references to the static bicubic interpolator from the docs diff --git a/configure.in b/configure.in index 0369bab9..9a3db776 100644 --- a/configure.in +++ b/configure.in @@ -2,7 +2,7 @@ # also update the version number in the m4 macros below -AC_INIT(vips, 7.28.9, vipsip@jiscmail.ac.uk) +AC_INIT(vips, 7.28.10, vipsip@jiscmail.ac.uk) # required for gobject-introspection AC_PREREQ(2.62) @@ -15,7 +15,7 @@ AC_CONFIG_MACRO_DIR([m4]) # user-visible library versioning m4_define([vips_major_version], [7]) m4_define([vips_minor_version], [28]) -m4_define([vips_micro_version], [9]) +m4_define([vips_micro_version], [10]) m4_define([vips_version], [vips_major_version.vips_minor_version.vips_micro_version]) @@ -35,7 +35,7 @@ VIPS_VERSION_STRING=$VIPS_VERSION-`date` # interface changes not backwards compatible?: reset age to 0 LIBRARY_CURRENT=33 -LIBRARY_REVISION=1 +LIBRARY_REVISION=2 LIBRARY_AGE=1 # patched into include/vips/version.h diff --git a/libvips/arithmetic/math2.c b/libvips/arithmetic/math2.c index 3869e9c4..b6cfe6f4 100644 --- a/libvips/arithmetic/math2.c +++ b/libvips/arithmetic/math2.c @@ -22,6 +22,8 @@ * - im_powtra() adapated to make math2.c * 12/11/11 * - redone as a class + * 17/7/12 + * - wopconst was broken */ /* @@ -401,7 +403,7 @@ vips_math2_const_class_init( VipsMath2ConstClass *class ) _( "Operation" ), _( "math to perform" ), VIPS_ARGUMENT_REQUIRED_INPUT, - G_STRUCT_OFFSET( VipsMath2, math2 ), + G_STRUCT_OFFSET( VipsMath2Const, math2 ), VIPS_TYPE_OPERATION_MATH2, VIPS_OPERATION_MATH2_POW ); } From 467a78f32b32587563ceadb620cf09c58b47a554 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 17 Jul 2012 10:00:59 +0100 Subject: [PATCH 3/6] save as ppm from vips7 with options was broken it wrote a file with the options still in the name --- ChangeLog | 1 + libvips/deprecated/im_vips2ppm.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2804fe1e..68bf11bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ - vips_sign() was broken - png save compression range was wrong - more/moreeq was wrong +- vips7 ppm save with options was broken 18/6/12 started 7.28.9 - slightly more memory debugging output diff --git a/libvips/deprecated/im_vips2ppm.c b/libvips/deprecated/im_vips2ppm.c index 3fc21b9e..311aaf3c 100644 --- a/libvips/deprecated/im_vips2ppm.c +++ b/libvips/deprecated/im_vips2ppm.c @@ -66,5 +66,5 @@ im_vips2ppm( IMAGE *in, const char *filename ) } } - return( vips_ppmsave( in, filename, "ascii", ascii, NULL ) ); + return( vips_ppmsave( in, name, "ascii", ascii, NULL ) ); } From 4171f2673da8ddd743ed867abfbafc77c1502f23 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 17 Jul 2012 10:10:34 +0100 Subject: [PATCH 4/6] safer string equality in cache it could segv if operations had strings which had been set to NULL --- libvips/iofuncs/cache.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/libvips/iofuncs/cache.c b/libvips/iofuncs/cache.c index d15e8bb5..81fc6d26 100644 --- a/libvips/iofuncs/cache.c +++ b/libvips/iofuncs/cache.c @@ -265,9 +265,15 @@ vips_value_equal( GParamSpec *pspec, GValue *v1, GValue *v2 ) if( generic == G_TYPE_PARAM_DOUBLE ) return( g_value_get_double( v1 ) == g_value_get_double( v2 ) ); - if( generic == G_TYPE_PARAM_STRING ) - return( strcmp( g_value_get_string( v1 ), - g_value_get_string( v2 ) ) == 0 ); + if( generic == G_TYPE_PARAM_STRING ) { + const char *s1 = g_value_get_string( v1 ); + const char *s2 = g_value_get_string( v2 ); + + if( s1 == s2 ) + return( TRUE ); + else + return( s1 && s2 && strcmp( s1, s2 ) == 0 ); + } if( generic == G_TYPE_PARAM_BOXED ) return( g_value_get_boxed( v1 ) == g_value_get_boxed( v2 ) ); From 0b80d436c89aa943eb025cbb12cf6e1590ce2b67 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Tue, 17 Jul 2012 10:22:01 +0100 Subject: [PATCH 5/6] vips7 csv load with options was broken it used the string including the options as the filename --- libvips/deprecated/im_csv2vips.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvips/deprecated/im_csv2vips.c b/libvips/deprecated/im_csv2vips.c index 67e4fbcc..9493dd35 100644 --- a/libvips/deprecated/im_csv2vips.c +++ b/libvips/deprecated/im_csv2vips.c @@ -73,7 +73,7 @@ im_csv2vips( const char *filename, IMAGE *out ) lines = atoi( r ); } - if( vips_csvload( filename, &t, + if( vips_csvload( name, &t, "skip", start_skip, "lines", lines, "whitespace", whitespace, From 4af1dabb5a3f7104a4678ff963c8cba1251c838c Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Wed, 18 Jul 2012 10:13:03 +0100 Subject: [PATCH 6/6] don't cache write operations we want writes to happen every time, in case the file has been deleted by someone --- ChangeLog | 1 + libvips/foreign/foreign.c | 4 ++++ libvips/foreign/vips2tiff.c | 4 ++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 68bf11bd..26228eae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ - png save compression range was wrong - more/moreeq was wrong - vips7 ppm save with options was broken +- don't cache write operations 18/6/12 started 7.28.9 - slightly more memory debugging output diff --git a/libvips/foreign/foreign.c b/libvips/foreign/foreign.c index 3c2efeef..edef480c 100644 --- a/libvips/foreign/foreign.c +++ b/libvips/foreign/foreign.c @@ -1375,6 +1375,10 @@ vips_foreign_save_build( VipsObject *object ) vips_foreign_convert_saveable( save ) ) return( -1 ); + /* You mustn't cache write operations. + */ + vips_operation_set_nocache( VIPS_OPERATION( save ), TRUE ); + if( VIPS_OBJECT_CLASS( vips_foreign_save_parent_class )-> build( object ) ) return( -1 ); diff --git a/libvips/foreign/vips2tiff.c b/libvips/foreign/vips2tiff.c index ddec2f5f..8e681f8f 100644 --- a/libvips/foreign/vips2tiff.c +++ b/libvips/foreign/vips2tiff.c @@ -464,7 +464,7 @@ write_tiff_header( TiffWrite *tw, TIFF *tif, int width, int height ) TIFFSetField( tif, TIFFTAG_JPEGCOLORMODE, JPEGCOLORMODE_RGB ); } - if( tw->predictor != -1 ) + if( tw->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) TIFFSetField( tif, TIFFTAG_PREDICTOR, tw->predictor ); /* Don't write mad resolutions (eg. zero), it confuses some programs. @@ -1338,7 +1338,7 @@ tiff_copy( TiffWrite *tw, TIFF *out, TIFF *in ) CopyField( TIFFTAG_ROWSPERSTRIP, i32 ); CopyField( TIFFTAG_SUBFILETYPE, i32 ); - if( tw->predictor != -1 ) + if( tw->predictor != VIPS_FOREIGN_TIFF_PREDICTOR_NONE ) TIFFSetField( out, TIFFTAG_PREDICTOR, tw->predictor ); /* TIFFTAG_JPEGQUALITY is a pesudo-tag, so we can't copy it.