Open dannylamb opened 2 years ago
Hi @dannylamb,
OpenJpegProcessor uses OpenJPEG's opj_decompress tool to decode JP2s. Because of the I/O limitations of this tool, they have to be decoded to intermediate BMPs first, and then those are read back in and converted to the target format.
The error is coming from the Java Image I/O BMP reader, which is not liking the BMPs that opj_decompress is emitting. I don't really know how to work around this.
OpenJpegProcessor is a Rube Goldberg machine and needs to be replaced with something that accesses the native OpenJPEG library. But this is a long way off.
FWIW I encountered this recently, in our case the bug was rooted in 16-bit TIFF files had been compressed using opj_compress without downsampling to 8-bit. We fixed it by re-compressing the source image with proper downsampling source, though the JP2 file was quite old as well, so the newer version of OpenJPEG may also have helped?
Some JP2s we are trying to serve with Cantaloupe are returning 500 errors. From the logs I can see it is using OpenJpeg and a bmp is being created from obj_decompress. But it fails with 500 suddenly at the end.
In the output of the response I'm getting this error.
I'm not sure why it would be trying to create a bmp behind the scenes if the OpenJpegProcessor does not support that format, so I thought I'd raise this issue. Here's my relevant
ManualSelectionStrategy
configuration.