diff --git a/ChangeLog b/ChangeLog index ec7387c2..747c3b65 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ - vipsthumbnail knows about pdfload and svgload - added @page param to magickload - matload is more specific (thanks bithive) +- don't cache progressive jpg images 27/1/16 started 8.2.3 - fix a crash with SPARC byte-order labq vips images diff --git a/libvips/foreign/foreign.c b/libvips/foreign/foreign.c index 75c2fbcc..b51ab386 100644 --- a/libvips/foreign/foreign.c +++ b/libvips/foreign/foreign.c @@ -928,6 +928,7 @@ static VipsOperationFlags vips_foreign_load_operation_get_flags( VipsOperation *operation ) { VipsForeignLoad *load = VIPS_FOREIGN_LOAD( operation ); + VipsOperationFlags flags; flags = VIPS_OPERATION_CLASS( vips_foreign_load_parent_class )-> diff --git a/libvips/foreign/jpegload.c b/libvips/foreign/jpegload.c index 2e81077e..cc7a870c 100644 --- a/libvips/foreign/jpegload.c +++ b/libvips/foreign/jpegload.c @@ -179,6 +179,25 @@ typedef VipsForeignLoadJpegClass VipsForeignLoadJpegFileClass; G_DEFINE_TYPE( VipsForeignLoadJpegFile, vips_foreign_load_jpeg_file, vips_foreign_load_jpeg_get_type() ); +static VipsOperationFlags +vips_foreign_load_jpeg_operation_get_flags( VipsOperation *operation ) +{ + VipsForeignLoad *load = VIPS_FOREIGN_LOAD( operation ); + + VipsOperationFlags flags; + int multiscan; + + flags = VIPS_OPERATION_CLASS( vips_foreign_load_jpeg_parent_class )-> + get_flags( operation ); + if( load->out && + !vips_image_get_int( load->out, + "jpeg-multiscan", &multiscan ) && + multiscan ) + flags |= VIPS_OPERATION_NOCACHE; + + return( flags ); +} + static VipsForeignFlags vips_foreign_load_jpeg_file_get_flags_filename( const char *filename ) { @@ -229,6 +248,7 @@ vips_foreign_load_jpeg_file_class_init( VipsForeignLoadJpegFileClass *class ) { GObjectClass *gobject_class = G_OBJECT_CLASS( class ); VipsObjectClass *object_class = (VipsObjectClass *) class; + VipsOperationClass *operation_class = (VipsOperationClass *) class; VipsForeignClass *foreign_class = (VipsForeignClass *) class; VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class; @@ -238,6 +258,8 @@ vips_foreign_load_jpeg_file_class_init( VipsForeignLoadJpegFileClass *class ) object_class->nickname = "jpegload"; object_class->description = _( "load jpeg from file" ); + operation_class->get_flags = vips_foreign_load_jpeg_operation_get_flags; + foreign_class->suffs = jpeg_suffs; /* We are fast at is_a(), so high priority.