From 3b4f95597a9014a3f6221e077b7dcc3f6e2d8cfe Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Tue, 14 Jan 2020 08:34:54 +0000 Subject: [PATCH] Prevent use of sequentialRead for rotate ops #2016 --- docs/changelog.md | 3 +++ src/pipeline.cc | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index c4a4c0cf..778d2032 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -20,6 +20,9 @@ Requires libvips v8.9.0. * Ensure correct colour output for 16-bit, 2-channel PNG input with ICC profile. [#2013](https://github.com/lovell/sharp/issues/2013) +* Prevent use of sequentialRead for rotate operations. + [#2016](https://github.com/lovell/sharp/issues/2016) + * Correctly bind max width and height values when using withoutEnlargement. [#2024](https://github.com/lovell/sharp/pull/2024) [@BrychanOdlum](https://github.com/BrychanOdlum) diff --git a/src/pipeline.cc b/src/pipeline.cc index 751c45b4..395ea90a 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -1399,7 +1399,12 @@ NAN_METHOD(pipeline) { // Force random access for certain operations if (baton->input->access == VIPS_ACCESS_SEQUENTIAL) { - if (baton->trimThreshold > 0.0 || baton->normalise || baton->position == 16 || baton->position == 17) { + if ( + baton->trimThreshold > 0.0 || + baton->normalise || + baton->position == 16 || baton->position == 17 || + baton->angle != 0 || baton->rotationAngle != 0.0 + ) { baton->input->access = VIPS_ACCESS_RANDOM; } }