Skip to content

Commit

Permalink
Use copy rather than cache to prevent affine overcompute
Browse files Browse the repository at this point in the history
More predictable behaviour, see commit 14c3346 for context
  • Loading branch information
lovell committed Jul 10, 2023
1 parent 5522060 commit 9c547dc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/pipeline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ class PipelineWorker : public Napi::AsyncWorker {
MultiPageUnsupported(nPages, "Rotate");
std::vector<double> background;
std::tie(image, background) = sharp::ApplyAlpha(image, baton->rotationBackground, FALSE);
image = image.rotate(baton->rotationAngle, VImage::option()->set("background", background)).cache();
image = image.rotate(baton->rotationAngle, VImage::option()->set("background", background)).copy_memory();
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/unit/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ describe('Partial image extraction', function () {
if (err) throw err;
assert.strictEqual(380, info.width);
assert.strictEqual(280, info.height);
fixtures.assertSimilar(fixtures.expected('rotate-extract-45.jpg'), data, { threshold: 7 }, done);
fixtures.assertSimilar(fixtures.expected('rotate-extract-45.jpg'), data, done);
});
});

Expand Down

0 comments on commit 9c547dc

Please sign in to comment.