kornelski / pngquant

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

error: Read error (libpng failed) #297

Open vivekdhiman opened 6 years ago

vivekdhiman commented 6 years ago

Hi, I am trying to execute command as below which throw me the errors.

     String [] cmdPng = {"D:\\pngquant\\pngquant.exe", "--quality=90-95", localDir+assetDetails.getName(), "--ext", ".png", "--force"};
            LOGGER.info("Command is {}",Arrays.toString(cmd));

Logger output -- Command is [D:\pngquant\pngquant.exe, --quality=90-95, C:\Users\vdhim6\Desktop\imgcompression\test.png, --ext, .png, --force]

Error is --

error: Read error (libpng failed)
 error: cannot decode image C:\Users\vdhim6\Desktop\imgcompression\test.png
D:\pngquant>pngquant -h
pngquant, 2.11.7 (January 2018), by Kornel Lesinski, Greg Roelofs.
   Color profiles are supported via Little CMS. Using libpng 1.6.34.
kornelski commented 6 years ago

The image is corrupted.

vivekdhiman commented 6 years ago

This works fine if I do via command line. Hence I don't think image is corrupt. PFA.

Thanks, capture2 capture1

kornelski commented 6 years ago

Oh, that's interesting.