From dfff5984e8c2ddb43cdcffd6252394b677b2af35 Mon Sep 17 00:00:00 2001 From: Zach Leatherman Date: Fri, 9 Feb 2024 21:00:36 -0600 Subject: [PATCH] Update dependencies --- img.js | 5 +++++ package.json | 20 +++++++++++--------- test/test.js | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/img.js b/img.js index 2f8a6fe..f5256b7 100644 --- a/img.js +++ b/img.js @@ -607,6 +607,11 @@ class Image { let sharpFormatOptions = this.getSharpOptionsForFormat(outputFormat); let hasFormatOptions = Object.keys(sharpFormatOptions).length > 0; if(hasFormatOptions || outputFormat && metadata.format !== outputFormat) { + // https://github.com/lovell/sharp/issues/3680 + // Fix heic regression in sharp 0.33 + if(outputFormat === "heic" && !sharpFormatOptions.compression) { + sharpFormatOptions.compression = "av1"; + } sharpInstance.toFormat(outputFormat, sharpFormatOptions); } diff --git a/package.json b/package.json index fb78cc2..1825406 100644 --- a/package.json +++ b/package.json @@ -41,14 +41,14 @@ "brotli-size": "^4.0.0", "debug": "^4.3.4", "entities": "^4.5.0", - "image-size": "^1.0.2", + "image-size": "^1.1.1", "p-queue": "^6.6.2", - "sharp": "^0.32.6" + "sharp": "^0.33.2" }, "devDependencies": { "@11ty/eleventy": "^2.0.1", "@11ty/eleventy-plugin-webc": "^0.11.1", - "ava": "^5.3.1", + "ava": "^6.1.1", "eslint": "^8.52.0", "pixelmatch": "^5.3.0" }, @@ -57,11 +57,13 @@ "files": [ "./test/*.js" ], - "ignoredByWatcher": [ - "./.cache/*", - "./img/*", - "./test/img/*", - "./test/**/generated*" - ] + "watchMode": { + "ignoreChanges": [ + "./.cache/*", + "./img/*", + "./test/img/*", + "./test/**/generated*" + ] + } } } diff --git a/test/test.js b/test/test.js index 40650e2..a540b26 100644 --- a/test/test.js +++ b/test/test.js @@ -1066,7 +1066,7 @@ test("Animated gif", async t => { t.is(stats.gif[0].width, 400); t.is(stats.gif[0].height, 400); // it’s a big boi - t.true( stats.gif[0].size > 1000*1000 ); + t.true( stats.gif[0].size > 1000*999 ); }); test("Change hashLength", async t => {