mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Non-animated GIF output defaults to no-loop #3394
This commit is contained in:
@@ -224,4 +224,18 @@ describe('GIF input', () => {
|
||||
const after = await input.gif({ interPaletteMaxError: 100 }).toBuffer();
|
||||
assert.strict(before.length > after.length);
|
||||
});
|
||||
|
||||
it('non-animated input defaults to no-loop', async () => {
|
||||
for (const input of [fixtures.inputGif, fixtures.inputPng]) {
|
||||
const data = await sharp(input)
|
||||
.resize(8)
|
||||
.gif({ effort: 1 })
|
||||
.toBuffer();
|
||||
|
||||
const { format, pages, loop } = await sharp(data).metadata();
|
||||
assert.strictEqual('gif', format);
|
||||
assert.strictEqual(1, pages);
|
||||
assert.strictEqual(1, loop);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user