mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Use copy rather than cache to prevent affine overcompute
More predictable behaviour, see commit 14c3346 for context
This commit is contained in:
parent
5522060e9e
commit
9c547dc321
@ -119,7 +119,7 @@ class PipelineWorker : public Napi::AsyncWorker {
|
|||||||
MultiPageUnsupported(nPages, "Rotate");
|
MultiPageUnsupported(nPages, "Rotate");
|
||||||
std::vector<double> background;
|
std::vector<double> background;
|
||||||
std::tie(image, background) = sharp::ApplyAlpha(image, baton->rotationBackground, FALSE);
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ describe('Partial image extraction', function () {
|
|||||||
if (err) throw err;
|
if (err) throw err;
|
||||||
assert.strictEqual(380, info.width);
|
assert.strictEqual(380, info.width);
|
||||||
assert.strictEqual(280, info.height);
|
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);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user