From 955b2ac1ba4c92da607a6e2cb4064143ad7fc1ce Mon Sep 17 00:00:00 2001 From: atjn Date: Fri, 18 Jun 2021 15:51:20 +0200 Subject: [PATCH 1/4] Fix WebP sniffing some more --- libsquoosh/src/codecs.ts | 2 +- src/client/lazy-app/util/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libsquoosh/src/codecs.ts b/libsquoosh/src/codecs.ts index 6fdb5e82..e97c753c 100644 --- a/libsquoosh/src/codecs.ts +++ b/libsquoosh/src/codecs.ts @@ -282,7 +282,7 @@ export const codecs = { webp: { name: 'WebP', extension: 'webp', - detectors: [/^RIFF....WEBPVP8[LX ]/], + detectors: [/^RIFF....WEBPVP8[LX ]/s], dec: () => instantiateEmscriptenWasm(webpDec, webpDecWasm), enc: () => instantiateEmscriptenWasm(webpEnc, webpEncWasm), defaultEncoderOptions: { diff --git a/src/client/lazy-app/util/index.ts b/src/client/lazy-app/util/index.ts index 24a21f93..f7152182 100644 --- a/src/client/lazy-app/util/index.ts +++ b/src/client/lazy-app/util/index.ts @@ -95,7 +95,7 @@ const magicNumberMapInput = [ [/^I I/, 'image/tiff'], [/^II*/, 'image/tiff'], [/^MM\x00*/, 'image/tiff'], - [/^RIFF....WEBPVP8[LX ]/, 'image/webp'], + [/^RIFF....WEBPVP8[LX ]/s, 'image/webp'], [/^\xF4\xFF\x6F/, 'image/webp2'], [/^\x00\x00\x00 ftypavif\x00\x00\x00\x00/, 'image/avif'], [/^\xff\x0a/, 'image/jxl'], From d604e94ad2db0c70420947c5124f592d89d733a3 Mon Sep 17 00:00:00 2001 From: atjn Date: Fri, 18 Jun 2021 21:18:37 +0200 Subject: [PATCH 2/4] Specify supported node versions --- cli/package-lock.json | 3 +++ cli/package.json | 3 +++ libsquoosh/package.json | 3 +++ 3 files changed, 9 insertions(+) diff --git a/cli/package-lock.json b/cli/package-lock.json index ff57bb64..3f4e6885 100644 --- a/cli/package-lock.json +++ b/cli/package-lock.json @@ -18,6 +18,9 @@ "bin": { "cli": "src/index.js", "squoosh-cli": "src/index.js" + }, + "engines": { + "node": " ^12.20.2 || ^14.13.1 || ^16.0.0 " } }, "node_modules/@squoosh/lib": { diff --git a/cli/package.json b/cli/package.json index 7131fa83..6b5c0617 100644 --- a/cli/package.json +++ b/cli/package.json @@ -14,6 +14,9 @@ "keywords": [], "author": "Google Chrome Developers ", "license": "Apache-2.0", + "engines": { + "node": " ^12.20.2 || ^14.13.1 || ^16.0.0 " + }, "dependencies": { "@squoosh/lib": "^0.2.0", "commander": "^7.2.0", diff --git a/libsquoosh/package.json b/libsquoosh/package.json index 53d9579d..c8baa876 100644 --- a/libsquoosh/package.json +++ b/libsquoosh/package.json @@ -13,6 +13,9 @@ "keywords": [], "author": "Google Chrome Developers ", "license": "Apache-2.0", + "engines": { + "node": " ^12.5.0 || ^14.0.0 || ^16.0.0 " + }, "dependencies": { "web-streams-polyfill": "^3.0.3" }, From aea316c604b0fbadbe4670ed33dee8f703b59225 Mon Sep 17 00:00:00 2001 From: Simon G Date: Sat, 19 Jun 2021 11:40:52 +0200 Subject: [PATCH 3/4] fix(cli): append suffix option at the end - close #1062 --- cli/src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/index.js b/cli/src/index.js index 697e4f52..331d31b7 100755 --- a/cli/src/index.js +++ b/cli/src/index.js @@ -177,8 +177,8 @@ async function processFiles(files) { jobsFinished++; const outputPath = path.join( program.opts().outputDir, - program.opts().suffix + - path.basename(originalFile, path.extname(originalFile)), + path.basename(originalFile, path.extname(originalFile)) + + program.opts().suffix ); for (const output of Object.values(image.encodedWith)) { const outputFile = `${outputPath}.${(await output).extension}`; From f6f70c590eecbd185758db044b481f5bf0b8d4ce Mon Sep 17 00:00:00 2001 From: Vajahath Ahmed Date: Mon, 21 Jun 2021 16:29:21 +0530 Subject: [PATCH 4/4] Add repo info in package.json so that people can backtrack from npm site (#1066) --- cli/package.json | 5 +++++ libsquoosh/package.json | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/cli/package.json b/cli/package.json index 7131fa83..72596725 100644 --- a/cli/package.json +++ b/cli/package.json @@ -4,6 +4,11 @@ "description": "A CLI for Squoosh", "public": true, "type": "module", + "homepage": "https://github.com/GoogleChromeLabs/squoosh", + "repository": { + "type": "git", + "url": "https://github.com/GoogleChromeLabs/squoosh.git" + }, "bin": { "squoosh-cli": "src/index.js", "@squoosh/cli": "src/index.js" diff --git a/libsquoosh/package.json b/libsquoosh/package.json index 53d9579d..4eab611b 100644 --- a/libsquoosh/package.json +++ b/libsquoosh/package.json @@ -12,6 +12,11 @@ }, "keywords": [], "author": "Google Chrome Developers ", + "homepage": "https://github.com/GoogleChromeLabs/squoosh", + "repository": { + "type": "git", + "url": "https://github.com/GoogleChromeLabs/squoosh.git" + }, "license": "Apache-2.0", "dependencies": { "web-streams-polyfill": "^3.0.3"