Improve error for unsupported multi-page rotation #3940

This commit is contained in:
Lovell Fuller
2024-01-11 11:59:01 +00:00
parent 45e8071599
commit cbf68c1395
5 changed files with 34 additions and 0 deletions

View File

@@ -353,6 +353,21 @@ describe('Rotation', function () {
)
);
it('Animated image rotate 180', () =>
assert.doesNotReject(() => sharp(fixtures.inputGifAnimated, { animated: true })
.rotate(180)
.toBuffer()
)
);
it('Animated image rotate non-180 rejects', () =>
assert.rejects(() => sharp(fixtures.inputGifAnimated, { animated: true })
.rotate(90)
.toBuffer(),
/Rotate is not supported for multi-page images/
)
);
it('Multiple rotate emits warning', () => {
let warningMessage = '';
const s = sharp();