don't cache progressive jpg images
progressive jpg images need loads of memory, we shouldn't cache them by default ... our called can hold a ref if they want to keep the image around see https://github.com/jcupitt/libvips/issues/387
This commit is contained in:
parent
307895eb41
commit
6f94cb5ed4
@ -6,6 +6,7 @@
|
|||||||
- vipsthumbnail knows about pdfload and svgload
|
- vipsthumbnail knows about pdfload and svgload
|
||||||
- added @page param to magickload
|
- added @page param to magickload
|
||||||
- matload is more specific (thanks bithive)
|
- matload is more specific (thanks bithive)
|
||||||
|
- don't cache progressive jpg images
|
||||||
|
|
||||||
27/1/16 started 8.2.3
|
27/1/16 started 8.2.3
|
||||||
- fix a crash with SPARC byte-order labq vips images
|
- fix a crash with SPARC byte-order labq vips images
|
||||||
|
@ -928,6 +928,7 @@ static VipsOperationFlags
|
|||||||
vips_foreign_load_operation_get_flags( VipsOperation *operation )
|
vips_foreign_load_operation_get_flags( VipsOperation *operation )
|
||||||
{
|
{
|
||||||
VipsForeignLoad *load = VIPS_FOREIGN_LOAD( operation );
|
VipsForeignLoad *load = VIPS_FOREIGN_LOAD( operation );
|
||||||
|
|
||||||
VipsOperationFlags flags;
|
VipsOperationFlags flags;
|
||||||
|
|
||||||
flags = VIPS_OPERATION_CLASS( vips_foreign_load_parent_class )->
|
flags = VIPS_OPERATION_CLASS( vips_foreign_load_parent_class )->
|
||||||
|
@ -179,6 +179,25 @@ typedef VipsForeignLoadJpegClass VipsForeignLoadJpegFileClass;
|
|||||||
G_DEFINE_TYPE( VipsForeignLoadJpegFile, vips_foreign_load_jpeg_file,
|
G_DEFINE_TYPE( VipsForeignLoadJpegFile, vips_foreign_load_jpeg_file,
|
||||||
vips_foreign_load_jpeg_get_type() );
|
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
|
static VipsForeignFlags
|
||||||
vips_foreign_load_jpeg_file_get_flags_filename( const char *filename )
|
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 );
|
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
|
||||||
VipsObjectClass *object_class = (VipsObjectClass *) class;
|
VipsObjectClass *object_class = (VipsObjectClass *) class;
|
||||||
|
VipsOperationClass *operation_class = (VipsOperationClass *) class;
|
||||||
VipsForeignClass *foreign_class = (VipsForeignClass *) class;
|
VipsForeignClass *foreign_class = (VipsForeignClass *) class;
|
||||||
VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) 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->nickname = "jpegload";
|
||||||
object_class->description = _( "load jpeg from file" );
|
object_class->description = _( "load jpeg from file" );
|
||||||
|
|
||||||
|
operation_class->get_flags = vips_foreign_load_jpeg_operation_get_flags;
|
||||||
|
|
||||||
foreign_class->suffs = jpeg_suffs;
|
foreign_class->suffs = jpeg_suffs;
|
||||||
|
|
||||||
/* We are fast at is_a(), so high priority.
|
/* We are fast at is_a(), so high priority.
|
||||||
|
Loading…
Reference in New Issue
Block a user