Skip to content

Commit

Permalink
Prevent use of sequentialRead for rotate ops #2016
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Jan 14, 2020
1 parent bd52e93 commit 3b4f955
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion src/pipeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 3b4f955

Please sign in to comment.