Search code examples
javatiffwebp

cwebp errors on some files


I am trying to convert TIFF Images to WEBP. I have the latest cwebp.exe binary from Google. To access this binary, I am utilizing code that was graciously made available here: https://stackoverflow.com/a/65998284

There are no problems executing this or the binary from within Java.

However, on some files, the conversion is erroring with the error:

Decoding of input data failed.
Status: 3(BITSTREAM_ERROR)
Error! Could not process file '...filepath...'
Error! Cannot read input picture file '...filepath...'

The file names are in the pattern ###-###.tif

I can run the cwebp.exe binary from the command line and successfully convert these files with the same options.


Solution

  • I worked around this issue by first converting the tiff images to png format and then using the img2webp binary compiled/provided by Google. Not the most optimal solution but it worked for what I needed.