Skip to content

Commit 8970df2

Browse files
committed
try disabling operation cache for magickload
magickload can eat huge amounts of memory and disc, fon't keep it in the operation cache see https://github.com/jcupitt/libvips/issues/731
1 parent 739389d commit 8970df2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

libvips/foreign/magickload.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* - add @page option, 0 by default
1111
* 25/11/16
1212
* - add @n, deprecate @all_frames (just sets n = -1)
13+
* 8/9/17
14+
* - don't cache magickload
1315
*/
1416

1517
/*
@@ -95,6 +97,7 @@ vips_foreign_load_magick_class_init( VipsForeignLoadMagickClass *class )
9597
{
9698
GObjectClass *gobject_class = G_OBJECT_CLASS( class );
9799
VipsObjectClass *object_class = (VipsObjectClass *) class;
100+
VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class );
98101
VipsForeignClass *foreign_class = (VipsForeignClass *) class;
99102
VipsForeignLoadClass *load_class = (VipsForeignLoadClass *) class;
100103

@@ -104,6 +107,10 @@ vips_foreign_load_magick_class_init( VipsForeignLoadMagickClass *class )
104107
object_class->nickname = "magickload_base";
105108
object_class->description = _( "load with ImageMagick" );
106109

110+
/* Don't cache magickload: it can gobble up memory and disc.
111+
*/
112+
operation_class->flags = VIPS_OPERATION_NOCACHE;
113+
107114
/* We need to be well to the back of the queue since vips's
108115
* dedicated loaders are usually preferable.
109116
*/

0 commit comments

Comments
 (0)