Search code examples
pythonerror-handlinglibjpegopenslide

Openslide libjpeg error: Wrong JPEG library version


I'm working with Openslide's python bindings. I am using Tif images, which are supported by Openslide. It seems I am able to use the methods read_region and get_thumbnail with a smaller, binary masked Tif of about 100 mb's.

However, with a larger, RGBa Tif of about 1.5 Gb, I get the following error:

openslide.lowlevel.OpenSlideError: Wrong JPEG library version: library is 90, caller expects 80

I have libjpeg8d installed, and everything seems fine with a smaller Tif. Any suggestions on how fix this issue?


Solution

  • I would guess your smaller TIFF is not JPEG-compressed, but your larger one is.

    When libtiff starts the jpeg decoder, it checks that the version number in the libjpeg library binary matches the version number in the libjpeg headers that it was compiled against, and if they do not match, it prints the warning you are seeing.

    The error means that you have installed a new jpeg library, but not recompiled libtiff or perhaps openslide.

    You don't say what platform you are using, but on linux these issues should all be handled for you by your package manager, as long as you stick to the supported versions. If you've built any parts of the system yourself, you'll need to recheck how each part was configured and installed, and how your environment has been set up.