kornelski / pngquant

Lossy PNG compressor — pngquant command based on libimagequant library
https://pngquant.org
Other
5.09k stars 476 forks source link

Input and output parameters #395

Closed acteds closed 2 years ago

acteds commented 2 years ago

Batch (.bat)

Use parameters:

pngquant.exe --force --speed 1 - >"%%~a-out.png" <"%%~a"

When used in batches, sometimes:

  1. The output file size is 0
  2. The output file is not a valid image and cannot be opened
  3. The image content of the output file is partially lost and can be opened

Use parameters:

pngquant.exe --force --speed 1 --output "%%~a-out.png" "%%~a"

No above problems, what is the reason?

kornelski commented 2 years ago

When you use >, pngquant isn't creating the file, your shell (cmd.exe) is. It's outside of my control.

acteds commented 2 years ago

When you use >, pngquant isn't creating the file, your shell (cmd.exe) is. It's outside of my control.

I see.