mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-12 00:37:19 +00:00
Add suffix support
This commit is contained in:
@@ -31,6 +31,7 @@ export async function binarySearch(
|
|||||||
round++;
|
round++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function autoOptimize(
|
export async function autoOptimize(
|
||||||
bitmapIn,
|
bitmapIn,
|
||||||
encode,
|
encode,
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ async function processFiles(files) {
|
|||||||
let jobsFinished = 0;
|
let jobsFinished = 0;
|
||||||
for (const { file, bitmap, size } of decodedFiles) {
|
for (const { file, bitmap, size } of decodedFiles) {
|
||||||
const ext = extname(file);
|
const ext = extname(file);
|
||||||
const base = basename(file, ext);
|
const base = basename(file, ext) + program.suffix;
|
||||||
|
|
||||||
for (const [encName, value] of Object.entries(supportedFormats)) {
|
for (const [encName, value] of Object.entries(supportedFormats)) {
|
||||||
if (!program[encName]) {
|
if (!program[encName]) {
|
||||||
@@ -170,6 +170,7 @@ if (isMainThread) {
|
|||||||
.version(version)
|
.version(version)
|
||||||
.arguments("<files...>")
|
.arguments("<files...>")
|
||||||
.option("-d, --output-dir <dir>", "Output directory", ".")
|
.option("-d, --output-dir <dir>", "Output directory", ".")
|
||||||
|
.option("-s, --suffix <suffix>", "Append suffix to output files", "")
|
||||||
.option(
|
.option(
|
||||||
"--max-optimizer-rounds <rounds>",
|
"--max-optimizer-rounds <rounds>",
|
||||||
"Maximum number of compressions to use for auto optimizations",
|
"Maximum number of compressions to use for auto optimizations",
|
||||||
|
|||||||
Reference in New Issue
Block a user