mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Expose reoptimise palette option for GIF output
This commit is contained in:
@@ -80,6 +80,22 @@ describe('GIF input', () => {
|
||||
assert.strictEqual(true, reduced.length < original.length);
|
||||
});
|
||||
|
||||
it('valid optimise', () => {
|
||||
assert.doesNotThrow(() => sharp().gif({ reoptimise: true }));
|
||||
assert.doesNotThrow(() => sharp().gif({ reoptimize: true }));
|
||||
});
|
||||
|
||||
it('invalid reoptimise throws', () => {
|
||||
assert.throws(
|
||||
() => sharp().gif({ reoptimise: -1 }),
|
||||
/Expected boolean for gifReoptimise but received -1 of type number/
|
||||
);
|
||||
assert.throws(
|
||||
() => sharp().gif({ reoptimize: 'fail' }),
|
||||
/Expected boolean for gifReoptimise but received fail of type string/
|
||||
);
|
||||
});
|
||||
|
||||
it('invalid loop throws', () => {
|
||||
assert.throws(() => {
|
||||
sharp().gif({ loop: -1 });
|
||||
|
||||
Reference in New Issue
Block a user