Use copy rather than cache to prevent affine overcompute

More predictable behaviour, see commit 14c3346 for context
This commit is contained in:
Lovell Fuller 2023-07-10 13:36:26 +01:00
parent 5522060e9e
commit 9c547dc321
2 changed files with 2 additions and 2 deletions

View File

@ -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();
}
}

View File

@ -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);
});
});