From d9af897595dbbdcea560b5fcdbc09c0438d740b4 Mon Sep 17 00:00:00 2001 From: Lovell Fuller Date: Mon, 8 Mar 2021 15:57:27 +0000 Subject: [PATCH] Tests: ensure AVIF order is read, write, read+write --- test/unit/avif.js | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/test/unit/avif.js b/test/unit/avif.js index 780617dd..37ba7301 100644 --- a/test/unit/avif.js +++ b/test/unit/avif.js @@ -12,29 +12,6 @@ describe('AVIF', () => { }); }); - it('can passthrough AVIF', async () => { - const data = await sharp(inputAvif) - .resize(32) - .toBuffer(); - const metadata = await sharp(data) - .metadata(); - const { compression, size, ...metadataWithoutSize } = metadata; - assert.deepStrictEqual(metadataWithoutSize, { - channels: 3, - depth: 'uchar', - format: 'heif', - hasAlpha: false, - hasProfile: false, - height: 12, - isProgressive: false, - pageHeight: 12, - pagePrimary: 0, - pages: 1, - space: 'srgb', - width: 32 - }); - }); - it('can convert AVIF to JPEG', async () => { const data = await sharp(inputAvif) .resize(32) @@ -81,4 +58,27 @@ describe('AVIF', () => { width: 32 }); }); + + it('can passthrough AVIF', async () => { + const data = await sharp(inputAvif) + .resize(32) + .toBuffer(); + const metadata = await sharp(data) + .metadata(); + const { compression, size, ...metadataWithoutSize } = metadata; + assert.deepStrictEqual(metadataWithoutSize, { + channels: 3, + depth: 'uchar', + format: 'heif', + hasAlpha: false, + hasProfile: false, + height: 12, + isProgressive: false, + pageHeight: 12, + pagePrimary: 0, + pages: 1, + space: 'srgb', + width: 32 + }); + }); });