diff --git a/ChangeLog b/ChangeLog index 4f5ee6a6..357f5cc0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -24,6 +24,7 @@ data - added vips_format_get_flags() - oop, forgot to check for cancel during tiled tiff write +- don't use mmap for tiff read: no performance advantage, chews up VM 11/9/08 started 7.16.3 - oop typo in manpage for im_project() diff --git a/libsrc/convolution/im_shrink.c b/libsrc/convolution/im_shrink.c index 101041a8..7dbef949 100644 --- a/libsrc/convolution/im_shrink.c +++ b/libsrc/convolution/im_shrink.c @@ -32,6 +32,8 @@ * - more typedef * 3/7/95 JC * - IM_CODING_LABQ handling added here + * 20/12/08 + * - fall back to im_copy() for 1/1 shrink */ /* @@ -296,7 +298,10 @@ shrink( IMAGE *in, IMAGE *out, double xshrink, double yshrink ) int im_shrink( IMAGE *in, IMAGE *out, double xshrink, double yshrink ) { - if( in->Coding == IM_CODING_LABQ ) { + if( xshrink == 1 && yshrink == 1 ) { + return( im_copy( in, out ) ); + } + else if( in->Coding == IM_CODING_LABQ ) { IMAGE *t[2]; if( im_open_local_array( out, t, 2, "im_shrink:1", "p" ) || diff --git a/libsrc/format/im_tiff2vips.c b/libsrc/format/im_tiff2vips.c index c83052ff..c6b8a692 100644 --- a/libsrc/format/im_tiff2vips.c +++ b/libsrc/format/im_tiff2vips.c @@ -103,6 +103,9 @@ * - allow CMYKA (thanks Doron) * 15/8/08 * - reorganise for image format system + * 20/12/08 + * - dont read with mmap: no performance advantage with libtiff, chews up + * VM wastefully */ /* @@ -1395,9 +1398,10 @@ get_directory( const char *filename, int page ) TIFF *tif; int i; - /* No need to use "b" and it means something different anyway. + /* No mmap --- no performance advantage with libtiff, and it burns up + * our VM if the tiff file is large. */ - if( !(tif = TIFFOpen( filename, "r" )) ) { + if( !(tif = TIFFOpen( filename, "rm" )) ) { im_error( "im_tiff2vips", _( "unable to open \"%s\" for input" ), filename ); @@ -1520,11 +1524,7 @@ istifftiled( const char *filename ) TIFFSetErrorHandler( (TIFFErrorHandler) im__thandler_error ); TIFFSetWarningHandler( (TIFFErrorHandler) im__thandler_warning ); -#ifdef BINARY_OPEN - if( !(tif = TIFFOpen( filename, "rb" )) ) { -#else /*BINARY_OPEN*/ - if( !(tif = TIFFOpen( filename, "r" )) ) { -#endif /*BINARY_OPEN*/ + if( !(tif = TIFFOpen( filename, "rm" )) ) { /* Not a TIFF file ... return False. */ im_error_clear();