From 1a98c390fce9ad333b1c7db2c432f8c9491ad5d1 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 20 Jan 2020 21:50:43 +0000 Subject: [PATCH] Prevent sequentialRead for EXIF-based rotate op #2042 --- docs/changelog.md | 5 +++++ src/pipeline.cc | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/changelog.md b/docs/changelog.md index 5b2e9f23..297b4b27 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -4,6 +4,11 @@ Requires libvips v8.9.0. +### v0.24.1 - TBD + +* Prevent use of sequentialRead for EXIF-based rotate operation. + [#2042](https://github.com/lovell/sharp/issues/2042) + ### v0.24.0 - 16th January 2020 * Drop support for Node.js 8. diff --git a/src/pipeline.cc b/src/pipeline.cc index 4745c4be..5c38beae 100644 --- a/src/pipeline.cc +++ b/src/pipeline.cc @@ -1404,7 +1404,9 @@ NAN_METHOD(pipeline) { baton->trimThreshold > 0.0 || baton->normalise || baton->position == 16 || baton->position == 17 || - baton->angle != 0 || baton->rotationAngle != 0.0 + baton->angle % 360 != 0 || + fmod(baton->rotationAngle, 360.0) != 0.0 || + baton->useExifOrientation ) { baton->input->access = VIPS_ACCESS_RANDOM; }