robcast / digilib

A versatile image viewing environment for the internet.
https://robcast.github.io/digilib/
GNU Lesser General Public License v3.0
18 stars 7 forks source link

Default image reader can't read images saved in `CMYK` colorspace #33

Closed aindlq closed 4 years ago

aindlq commented 4 years ago

Not really a bug, just something that is good to know.

Default image reader - com.sun.imageio.plugins.jpeg.JPEGImageReader can't read images saved in CMYK colorspace. Digilib just throws exception with "Unable to load File!" and somehow doesn't propagate initial exception that has more helpful error message - "Incompatible color conversion".

The solution is to use com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader instead.

To build digilib docker image with twelvemonkeys reader: docker build --no-cache --build-arg MVN_ARGS=-Dimageio=12m -f build/docker/Dockerfile -t digilib:snapshot .

robcast commented 4 years ago

Thanks for the tip @aindlq

I'll try to improve the error messages in the log. I already started to fiddle with the exception passing but I have to be more thorough :-)

Ceterum censeo, CMYK JPEG should never have been invented and all other use of CMYK should have been strictly limited to people directly working with printing machines ;-)