From 3810f642d3b28feb62d9eac7d194fdcd3f6790bf Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 14 Apr 2015 21:31:20 +0100 Subject: [PATCH] Add small cache before convolution for seq access --- src/resize.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/resize.cc b/src/resize.cc index e74d7051..e11b214d 100755 --- a/src/resize.cc +++ b/src/resize.cc @@ -459,6 +459,15 @@ class ResizeWorker : public NanAsyncWorker { return Error(); } vips_object_local(hook, gaussian); + // Sequential input requires a small linecache before use of convolution + if (baton->accessMethod == VIPS_ACCESS_SEQUENTIAL) { + VipsImage *lineCached; + if (vips_linecache(image, &lineCached, "access", VIPS_ACCESS_SEQUENTIAL, "tile_height", 1, "threaded", TRUE, NULL)) { + return Error(); + } + vips_object_local(hook, lineCached); + image = lineCached; + } // Apply Gaussian function VipsImage *blurred; if (vips_convsep(image, &blurred, gaussian, "precision", VIPS_PRECISION_INTEGER, NULL)) {