Ensure extend op stays sequential when copying px #3928

This commit is contained in:
Lovell Fuller
2024-01-04 09:24:41 +00:00
parent 4aacee8055
commit 9bcf399b4c
3 changed files with 18 additions and 0 deletions

View File

@@ -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) {
sharp(fixtures.inputPngWithTransparency16bit)
.resize(120)