imagecodecs icon indicating copy to clipboard operation
imagecodecs copied to clipboard

Use libjpeg-turbo for all Lossless JPEG bit depths

Open SimonSegerblomRex opened this issue 8 months ago • 13 comments

Enabled by the solution to https://github.com/libjpeg-turbo/libjpeg-turbo/issues/768 (Planned to be included in libjpeg-turbo release 3.1.0.)

There are still some Lossless JPEG encoded images that libjpeg-turbo refuses to decode, see the discussions in:

  • https://github.com/libjpeg-turbo/libjpeg-turbo/issues/586
  • https://github.com/libjpeg-turbo/libjpeg-turbo/issues/765

Note to self while testing with local copy of libjpeg-turbo: Put this in the customize_build function used by setup.py:

libjpeg_turbo_path = <path to libjpeg-turbo>
EXTENSIONS['jpeg8']['sources'] = []
EXTENSIONS['jpeg8']['include_dirs'] = [libjpeg_turbo_path + "/src"]  # moved to src in the dev branch
EXTENSIONS['jpeg8']['library_dirs'] = [libjpeg_turbo_path]

and make sure to set

export LD_LIBRARY_PATH=<libjpeg_turbo_path>

before running any python script importing imagecodecs.

SimonSegerblomRex avatar Jun 24 '24 13:06 SimonSegerblomRex