mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Ensure composite can tile with outside resize #3227
This commit is contained in:
@@ -420,4 +420,31 @@ describe('composite', () => {
|
||||
|
||||
assert.deepStrictEqual(red, { r, g, b });
|
||||
});
|
||||
|
||||
it('Ensure tiled composition works with resized fit=outside', async () => {
|
||||
const { info } = await sharp({
|
||||
create: {
|
||||
width: 41, height: 41, channels: 3, background: 'red'
|
||||
}
|
||||
})
|
||||
.resize({
|
||||
width: 10,
|
||||
height: 40,
|
||||
fit: 'outside'
|
||||
})
|
||||
.composite([
|
||||
{
|
||||
input: {
|
||||
create: {
|
||||
width: 16, height: 16, channels: 3, background: 'green'
|
||||
}
|
||||
},
|
||||
tile: true
|
||||
}
|
||||
])
|
||||
.toBuffer({ resolveWithObject: true });
|
||||
|
||||
assert.strictEqual(info.width, 40);
|
||||
assert.strictEqual(info.height, 40);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user