Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Surma
2021-06-21 12:58:41 +01:00
6 changed files with 23 additions and 4 deletions

3
cli/package-lock.json generated
View File

@@ -18,6 +18,9 @@
"bin": { "bin": {
"cli": "src/index.js", "cli": "src/index.js",
"squoosh-cli": "src/index.js" "squoosh-cli": "src/index.js"
},
"engines": {
"node": " ^12.20.2 || ^14.13.1 || ^16.0.0 "
} }
}, },
"node_modules/@squoosh/lib": { "node_modules/@squoosh/lib": {

View File

@@ -4,6 +4,11 @@
"description": "A CLI for Squoosh", "description": "A CLI for Squoosh",
"public": true, "public": true,
"type": "module", "type": "module",
"homepage": "https://github.com/GoogleChromeLabs/squoosh",
"repository": {
"type": "git",
"url": "https://github.com/GoogleChromeLabs/squoosh.git"
},
"bin": { "bin": {
"squoosh-cli": "src/index.js", "squoosh-cli": "src/index.js",
"@squoosh/cli": "src/index.js" "@squoosh/cli": "src/index.js"
@@ -14,6 +19,9 @@
"keywords": [], "keywords": [],
"author": "Google Chrome Developers <chromium-dev@google.com>", "author": "Google Chrome Developers <chromium-dev@google.com>",
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": {
"node": " ^12.20.2 || ^14.13.1 || ^16.0.0 "
},
"dependencies": { "dependencies": {
"@squoosh/lib": "^0.3.1", "@squoosh/lib": "^0.3.1",
"commander": "^7.2.0", "commander": "^7.2.0",

View File

@@ -177,8 +177,8 @@ async function processFiles(files) {
jobsFinished++; jobsFinished++;
const outputPath = path.join( const outputPath = path.join(
program.opts().outputDir, 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)) { for (const output of Object.values(image.encodedWith)) {
const outputFile = `${outputPath}.${(await output).extension}`; const outputFile = `${outputPath}.${(await output).extension}`;

View File

@@ -12,7 +12,15 @@
}, },
"keywords": [], "keywords": [],
"author": "Google Chrome Developers <chromium-dev@google.com>", "author": "Google Chrome Developers <chromium-dev@google.com>",
"homepage": "https://github.com/GoogleChromeLabs/squoosh",
"repository": {
"type": "git",
"url": "https://github.com/GoogleChromeLabs/squoosh.git"
},
"license": "Apache-2.0", "license": "Apache-2.0",
"engines": {
"node": " ^12.5.0 || ^14.0.0 || ^16.0.0 "
},
"dependencies": { "dependencies": {
"web-streams-polyfill": "^3.0.3" "web-streams-polyfill": "^3.0.3"
}, },

View File

@@ -282,7 +282,7 @@ export const codecs = {
webp: { webp: {
name: 'WebP', name: 'WebP',
extension: 'webp', extension: 'webp',
detectors: [/^RIFF....WEBPVP8[LX ]/], detectors: [/^RIFF....WEBPVP8[LX ]/s],
dec: () => instantiateEmscriptenWasm(webpDec, webpDecWasm), dec: () => instantiateEmscriptenWasm(webpDec, webpDecWasm),
enc: () => instantiateEmscriptenWasm(webpEnc, webpEncWasm), enc: () => instantiateEmscriptenWasm(webpEnc, webpEncWasm),
defaultEncoderOptions: { defaultEncoderOptions: {

View File

@@ -95,7 +95,7 @@ const magicNumberMapInput = [
[/^I I/, 'image/tiff'], [/^I I/, 'image/tiff'],
[/^II*/, 'image/tiff'], [/^II*/, 'image/tiff'],
[/^MM\x00*/, 'image/tiff'], [/^MM\x00*/, 'image/tiff'],
[/^RIFF....WEBPVP8[LX ]/, 'image/webp'], [/^RIFF....WEBPVP8[LX ]/s, 'image/webp'],
[/^\xF4\xFF\x6F/, 'image/webp2'], [/^\xF4\xFF\x6F/, 'image/webp2'],
[/^\x00\x00\x00 ftypavif\x00\x00\x00\x00/, 'image/avif'], [/^\x00\x00\x00 ftypavif\x00\x00\x00\x00/, 'image/avif'],
[/^\xff\x0a/, 'image/jxl'], [/^\xff\x0a/, 'image/jxl'],