question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[CLI] Batch image compression.

See original GitHub issue

I’m trying compress all of image in a folder at once.

So, I’ve execute this command,

squoosh-cli --mozjpeg '{"quality":75,"baseline":false,"arithmetic":false,"progressive":true,"op timize_coding":true,"smoothing":0,"color_space":3,"quant_table":3,"trellis_multipass":false,"trel lis_opt_zero":false,"trellis_opt_table":false,"trellis_loops":1,"auto_subsample":true,"chroma_sub sample":2,"separate_chroma_quality":false,"chroma_quality":75}' -d output ./*

After that Squoosh start compressing the folder images. It’s nicely showing 1.2.3.4.5.6…/17 - image decoding… But in few seconds, it’s gives error and stack on decoding screen.

[Error: EISDIR: illegal operation on a directory, read] {
  errno: -4068,
  code: 'EISDIR',
  syscall: 'read'
}
Worker error:  Error [RuntimeError]: abort(Error: EISDIR: illegal operation on a directory, read). Build with -s ASSERTIONS=1 for more info.
    at process.w (\npm\node_modules\@squoosh\cli\build\index.js:7:376640)
    at process.emit (events.js:327:22)
    at processPromiseRejections (internal/process/promises.js:209:33)
    at processTicksAndRejections (internal/process/task_queues.js:98:32)

  • Squoosh CLI version: 0.5.0
  • OS w/ version: Windows 8
  • Node version: v12.18.2
  • npm version: 6.14.9

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

6reactions
LucaDCScommented, Jul 28, 2021

For me works without the star, just like these:

npx @squoosh/cli --mozjpeg ‘{“quality”:60}’ -d Squooshed ./

image

BTW, To do it from .bat you have to do it without the single quotes, like this:

npx @squoosh/cli --mozjpeg {“quality”:60} -d Squooshed ./

image

Windows 10. Node v14.15.1 Squoosh CLI v0.7.2

3reactions
surmacommented, Dec 17, 2020

Yeah, I have heard that the CLI is currently causing problems on Windows. I’ll look into this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Optimize and Compress JPEG or PNG Images in Linux ...
To compress batch or multiple PNG images at once, just go the directory where all images resides and run the following command to...
Read more >
Batch Image compression tool for optimizing thousands of ...
I'm looking for some kind of tool that'll take a folder full of JPG pictures and will recompress them to their "optimal" compression...
Read more >
How Optimized Are Your Images? Meet ImageOptim-CLI, A ...
ImageOptim beats any single lossless optimizer by bundling all of them. It works by finding the best combination of compression parameters and ...
Read more >
batch - How can I compress images? - Ask Ubuntu
The pictures should be batch compressed, preferably via a GUI. ... single image to find good settings, then use the CLI to compress...
Read more >
How to batch compress images with Imagemagick or similar ...
In my experience, Imagemagick is the best image compressor program, and it gives one the most control over how to compress images. I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found