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.