#792 closed defect (fixed)

GeoTIFF 12 bit jpeg compression not supported

Reported by: dugalh Owned by: osgeo4w-dev@…
Priority: normal Component: Package
Version: Keywords: 12 bit jpeg geotiff
Cc: dugalh

Description

Hello, I get "ERROR 1: JPEGSetupEncode:BitsPerSample 12 not allowed for JPEG" when using gdal_translate with a 12 bit jpeg compressed geotiff as source. I am using the latest gdal (3.6.4). Is there something I can do to read this file?

Change History (5)

comment:1 by jratike80, 12 months ago

The requirements are documented in https://gdal.org/drivers/raster/gtiff.html

Starting with GDAL 3.4, if GDAL is built with its internal libtiff, read and write support for JPEG-in-TIFF compressed images with 12-bit sample is enabled by default (if JPEG support is also enabled), using GDAL internal libjpeg (based on IJG libjpeg-6b, with additional changes for 12-bit sample support). Support for JPEG with 12-bit sample is independent of whether 8-bit JPEG support is enabled through internal IJG libjpeg-6b or external libjpeg (like libjpeg-turbo)

comment:2 by dugalh, 12 months ago

Does that imply I need to build my own gdal, and not use the OSGeo4W one? Previous versions of OSGeo4W's gdal have worked with these files.

comment:3 by jef, 12 months ago

From https://gdal.org/development/building_from_source.html:

Starting with GDAL 3.7, if using libjpeg-turbo >= 2.2, which adds native support for dual 8/12-bit, using internal libjpeg-12 is no longer needed to get 12-bit JPEG support in the JPEG, MRF, NITF or GeoTIFF (when built with internal libtiff) drivers. If using external libtiff, libtiff >= 4.5 built against libjpeg-turbo >= 2.2 is needed to get 12-bit JPEG support in the GeoTIFF support.

"We" have libtiff 4.4.0 instead of current 4.5.0 and libjpeg-turbo 2.0.7-esr and it looks like 2.2 does not exists yet - the latest tag is 2.1.91 (main is 2.1.92)

comment:4 by dugalh, 12 months ago

OK... thanks. That sounds like it will be fixed some time in the not too distant future?

comment:5 by jef, 11 months ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.