Prevent use of sequentialRead for rotate ops #2016

This commit is contained in:
Lovell Fuller 2020-01-14 08:34:54 +00:00
parent bd52e93fca
commit 3b4f95597a
2 changed files with 9 additions and 1 deletions

View File

@ -20,6 +20,9 @@ Requires libvips v8.9.0.
* Ensure correct colour output for 16-bit, 2-channel PNG input with ICC profile. * Ensure correct colour output for 16-bit, 2-channel PNG input with ICC profile.
[#2013](https://github.com/lovell/sharp/issues/2013) [#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. * Correctly bind max width and height values when using withoutEnlargement.
[#2024](https://github.com/lovell/sharp/pull/2024) [#2024](https://github.com/lovell/sharp/pull/2024)
[@BrychanOdlum](https://github.com/BrychanOdlum) [@BrychanOdlum](https://github.com/BrychanOdlum)

View File

@ -1399,7 +1399,12 @@ NAN_METHOD(pipeline) {
// Force random access for certain operations // Force random access for certain operations
if (baton->input->access == VIPS_ACCESS_SEQUENTIAL) { 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; baton->input->access = VIPS_ACCESS_RANDOM;
} }
} }