From 7bcf0bb93f93abaf4793aa2777d1396165a3a188 Mon Sep 17 00:00:00 2001 From: John Cupitt Date: Mon, 29 May 2017 10:19:21 +0100 Subject: [PATCH] don't cache thumbnail thanks tomasc! see jcupitt/ruby-vips#109 --- ChangeLog | 1 + libvips/resample/thumbnail.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 912c9dba..289e9cd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ - raise b64 limit to allow for huge profiles (thanks jaume) - fix error return in blob save (thanks jaume) - tag vipsprofile as py2 (thanks ioquatix) +- don't cache thumbnail (thanks tomasc) 23/4/17 started 8.5.5 - doc polishing diff --git a/libvips/resample/thumbnail.c b/libvips/resample/thumbnail.c index a81bb99d..6211aed9 100644 --- a/libvips/resample/thumbnail.c +++ b/libvips/resample/thumbnail.c @@ -5,6 +5,8 @@ * - from vipsthumbnail.c * 6/1/17 * - add @size parameter + * 29/5/17 + * - don't cache (thanks tomasc) */ /* @@ -514,6 +516,7 @@ vips_thumbnail_class_init( VipsThumbnailClass *class ) { GObjectClass *gobject_class = G_OBJECT_CLASS( class ); VipsObjectClass *vobject_class = VIPS_OBJECT_CLASS( class ); + VipsOperationClass *operation_class = VIPS_OPERATION_CLASS( class ); gobject_class->dispose = vips_thumbnail_dispose; gobject_class->finalize = vips_thumbnail_finalize; @@ -524,6 +527,11 @@ vips_thumbnail_class_init( VipsThumbnailClass *class ) vobject_class->description = _( "thumbnail generation" ); vobject_class->build = vips_thumbnail_build; + /* We mustn't cache these calls, since we open the file or buffer in + * sequential mode. + */ + operation_class->flags = VIPS_OPERATION_NOCACHE; + VIPS_ARG_IMAGE( class, "out", 2, _( "Output" ), _( "Output image" ),