Unable to open JPEG compressed GeoTiff in Ubuntu 22.04 #444
Description
Hi,
I have written a program that uses the gdal
crate to read some parts of a GeoTiff file. The file is RGB data and uses JPEG compression. With any other compressions (I tested none and LZW) everything works as expected, but with JPEG on Ubuntu 22.04 the program fails to load the libjpeg shared lib:
ERROR 1: JPEGLib:Wrong JPEG library version: library is 62, caller expects 80
tif_jpeg.c:1021: JPEGSetupDecode: Assertion `sp->cinfo.comm.is_decompressor' failed.
Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
Note that my installed version of libjpeg is 8, I do not have version 6.2 on the system:
$ apt list --installed | grep jpeg
libjpeg-turbo8-dbg/jammy,now 2.1.2-0ubuntu1 amd64 [installed,automatic]
libjpeg-turbo8-dev/jammy,now 2.1.2-0ubuntu1 amd64 [installed]
libjpeg-turbo8/jammy,now 2.1.2-0ubuntu1 amd64 [installed,automatic]
libjpeg-turbo8/jammy,now 2.1.2-0ubuntu1 i386 [installed,automatic]
libjpeg8-dbg/jammy,now 8c-2ubuntu10 amd64 [installed]
libjpeg8-dev/jammy,now 8c-2ubuntu10 amd64 [installed]
libjpeg8/jammy,now 8c-2ubuntu10 amd64 [installed]
libjpeg8/jammy,now 8c-2ubuntu10 i386 [installed,automatic]
$ ls /usr/lib/x86_64-linux-gnu/libjpeg* -l
-rw-r--r-- 1 root root 820348 feb 21 2022 /usr/lib/x86_64-linux-gnu/libjpeg.a
lrwxrwxrwx 1 root root 12 feb 21 2022 /usr/lib/x86_64-linux-gnu/libjpeg.so -> libjpeg.so.8
lrwxrwxrwx 1 root root 16 ago 7 18:45 /usr/lib/x86_64-linux-gnu/libjpeg.so.8 -> libjpeg.so.8.2.2
-rw-r--r-- 1 root root 522960 feb 21 2022 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.2.2
lrwxrwxrwx 1 root root 16 gen 28 2022 /usr/lib/x86_64-linux-gnu/libjpegxr.so.0 -> libjpegxr.so.1.2
-rw-r--r-- 1 root root 223592 gen 28 2022 /usr/lib/x86_64-linux-gnu/libjpegxr.so.1.2
The interesting thing is that using my installed GDAL for instance with gdal_translate
or QGIS works as expected (reading JPEG compressed tiffs just fine), it's just rust programs using this library and dynamically linking to GDAL which fails to load.
I have tried on 3 different systems, all with Ubuntu 22.04, and none of them seems to work. I used apt to install GDAL (version 3.4).