Upgrade to libvips 8.10.6-alpha1

- Prebuilt binaries now include mozjpeg and libimagequant (BSD 2-Clause)
- Prebuilt binaries limit AVIF support to the most common 8-bit depth
- Add `mozjpeg` option to `jpeg` method, sets mozjpeg defaults
- Reduce the default PNG `compressionLevel` to the more commonly used 6
This commit is contained in:
Lovell Fuller
2021-03-07 15:55:38 +00:00
parent 8dffa28b4d
commit 984a9e653e
14 changed files with 123 additions and 53 deletions

View File

@@ -290,4 +290,24 @@ describe('JPEG', function () {
});
});
});
it('Can use mozjpeg defaults', async () => {
const withoutData = await sharp(fixtures.inputJpg)
.resize(32, 24)
.jpeg({ mozjpeg: false })
.toBuffer();
const withoutMeta = await sharp(withoutData).metadata();
assert.strictEqual(false, withoutMeta.isProgressive);
const withData = await sharp(fixtures.inputJpg)
.resize(32, 24)
.jpeg({ mozjpeg: true })
.toBuffer();
const withMeta = await sharp(withData).metadata();
assert.strictEqual(true, withMeta.isProgressive);
});
it('Invalid mozjpeg value throws error', () => {
assert.throws(() => sharp().jpeg({ mozjpeg: 'fail' }));
});
});