mirror of
https://github.com/lovell/sharp.git
synced 2025-07-09 18:40:16 +02:00
Ensure extend op stays sequential when copying px #3928
This commit is contained in:
parent
4aacee8055
commit
9bcf399b4c
@ -10,6 +10,9 @@ Requires libvips v8.15.0
|
|||||||
[#3914](https://github.com/lovell/sharp/pull/3914)
|
[#3914](https://github.com/lovell/sharp/pull/3914)
|
||||||
[@abhi0498](https://github.com/abhi0498)
|
[@abhi0498](https://github.com/abhi0498)
|
||||||
|
|
||||||
|
* Ensure `extend` operation stays sequential when copying (regression in 0.32.0).
|
||||||
|
[#3928](https://github.com/lovell/sharp/issues/3928)
|
||||||
|
|
||||||
### v0.33.1 - 17th December 2023
|
### v0.33.1 - 17th December 2023
|
||||||
|
|
||||||
* Add support for Yarn Plug'n'Play filesystem layout.
|
* Add support for Yarn Plug'n'Play filesystem layout.
|
||||||
|
@ -561,6 +561,7 @@ class PipelineWorker : public Napi::AsyncWorker {
|
|||||||
VImage::option()->set("extend", baton->extendWith)->set("background", background));
|
VImage::option()->set("extend", baton->extendWith)->set("background", background));
|
||||||
} else {
|
} else {
|
||||||
std::vector<double> ignoredBackground(1);
|
std::vector<double> ignoredBackground(1);
|
||||||
|
image = sharp::StaySequential(image, baton->input->access);
|
||||||
image = nPages > 1
|
image = nPages > 1
|
||||||
? sharp::EmbedMultiPage(image,
|
? sharp::EmbedMultiPage(image,
|
||||||
baton->extendLeft, baton->extendTop, baton->width, baton->height,
|
baton->extendLeft, baton->extendTop, baton->width, baton->height,
|
||||||
|
@ -73,6 +73,20 @@ describe('Extend', function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('extend top with mirroring uses ordered read', async () => {
|
||||||
|
const data = await sharp(fixtures.inputJpg)
|
||||||
|
.extend({
|
||||||
|
extendWith: 'mirror',
|
||||||
|
top: 1
|
||||||
|
})
|
||||||
|
.png({ compressionLevel: 0 })
|
||||||
|
.toBuffer();
|
||||||
|
|
||||||
|
const { width, height } = await sharp(data).metadata();
|
||||||
|
assert.strictEqual(2725, width);
|
||||||
|
assert.strictEqual(2226, height);
|
||||||
|
});
|
||||||
|
|
||||||
it(`extend sides unequally with RGBA (${extendWith})`, function (done) {
|
it(`extend sides unequally with RGBA (${extendWith})`, function (done) {
|
||||||
sharp(fixtures.inputPngWithTransparency16bit)
|
sharp(fixtures.inputPngWithTransparency16bit)
|
||||||
.resize(120)
|
.resize(120)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user