[Gdal-dev] NITF JPEG Compression

Frank Warmerdam warmerdam at pobox.com
Wed Sep 27 11:27:50 EDT 2006


Alan Stewart wrote:
> However, I am frequently seeing two JPEG-related errors from 
> gdal_translate:
> 
> ERROR 6: SetColorInterpretation() not supported for this dataset.

Alan,

This can be generally ignored.  It should really be thought of as a warning.
If you can provide details via a bug report on how to reproduce this I'll
try and fix the message.

> and
> 
> ERROR 1: libjpeg: Unsupported JPEG data precision 12

The default build of GDAL uses a libjpeg that only supports 8 bit
precision jpeg files.  There is a libjpeg variant available that
can dynamically support 8 or 12bit files which should resolve this
problem - but it can be pretty tricky to use.

> Also, files where before gdal_translate failed with:
> 
> ERROR 1: The file i_3051e.ntf appears to be an NITF file, but no image
> blocks were found on it.  GDAL cannot utilize non-image
> NITF files.
> GDALOpen failed - 1
> The file i_3051e.ntf appears to be an NITF file, but no image
> blocks were found on it.  GDAL cannot utilize non-image
> NITF files.
> 
> now cause an abend - Windows asks if you want to report the error to 
> Microsoft - with:
> 
> Warning 1: The file i_3051e.ntf appears to be an NITF file, but no image
> blocks were found on it.
> ERROR 5: GDALDataset::GetRasterBand(1) - Illegal band #

The NITF driver was modified since GDAL 1.3.2 to support reading CGM
graphics segments as metadata.  In order to allow reading this from
files with no image segment, I had to relax the requirement on there
actually being an image.  So now it is possible to open a non-image
NITF file, it just won't have any bands.

However, many applications and libraries do not properly work with
band-less GDAL files.  Often this takes the form of an assumption that
there is a band 1 to check for information like datatype.  I see the
GeoTIFF CreateCopy() method has this problem.  I have:

  1) modified gdal_translate to avoid calling GDALCreateCopy() if the
     input has no bands as it is unlikely to be useful, and likely to
     cause problems.
  2) Modified GTiffDataset::CreateCopy() to error out gracefully if
     there are no input bands.

Thanks for your feedback.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list