Opened 18 years ago

Closed 17 years ago

#1309 closed defect (fixed)

JPEG errors: SetColorInterpretation()

Reported by: astewart@… Owned by: warmerdam
Priority: normal Milestone: 1.5.0
Component: GDAL_Raster Version: unspecified
Severity: normal Keywords: NITF
Cc:

Description (last modified by warmerdam)

"ERROR 6: SetColorInterpretation() not supported for this dataset" emitted when gdalinfo is run on the NITF file at <http://www.gwg.nga.mil/ntb/baseline/software/TESTFILE/Nitfv2_0/U_2001D.NTF>. Other files at this URL that exhibit the same behaviour: U_2001E.NTF, U_2005A.NTF, U_2010A.NTF, U_2015A.NTF and U_2020A.NTF.

Change History (6)

comment:1 by warmerdam, 18 years ago

I was unable to reproduce this problem with GDAL CVS. 

Normally gdalinfo would not be calling SetColorInterpretation().  Are you
sure you were using gdalinfo, not gdal_translate? 


comment:2 by astewart@…, 18 years ago

Originally I did see the error with gdal_translate (which successfully produces a TIFF), not gdalinfo. However, I discovered while verifying the error that gdalinfo also is outputting the same error. I'm using the gdal-cvs-2006.09.26 snapshot. Following are logs from both.

gdalinfo U_2001D.NTF

ERROR 6: SetColorInterpretation() not supported for this dataset.
ERROR 6: SetColorInterpretation() not supported for this dataset.
ERROR 6: SetColorInterpretation() not supported for this dataset.
Driver: NITF/National Imagery Transmission Format
Size is 256, 256
Coordinate System is `'
Metadata:
  NITF_FHDR=NITF02.00
  NITF_CLEVEL=02
  NITF_STYPE=
  NITF_OSTAID=Right Here
  NITF_FDT=28074027ZAPR95
  NITF_FTITLE=checks color w/JPEG header marked w/ a comp. rate of 0.00 and ADS of 0. tracker
  NITF_FSCLAS=U
  NITF_FSCODE=
  NITF_FSCTLH=
  NITF_FSREL=
  NITF_FSCAUT=
  NITF_FSCTLN=
  NITF_FSDWNG=991231
  NITF_FSCOP=00001
  NITF_FSCPYS=00001
  NITF_ENCRYP=0
  NITF_ONAME=
  NITF_OPHONE=
  NITF_IID1=UNKNOWN000
  NITF_IDATIM=28074027ZAPR95
  NITF_TGTID=
  NITF_ITITLE=
  NITF_ISCLAS=U
  NITF_ISCODE=
  NITF_ISCTLH=
  NITF_ISREL=
  NITF_ISCAUT=
  NITF_ISCTLN=
  NITF_ISDWNG=991231
  NITF_ISORCE=
  NITF_PVTYPE=INT
  NITF_IREP=RGB
  NITF_ICAT=VIS
  NITF_ABPP=08
  NITF_PJUST=R
  NITF_IC=C3
  NITF_IMODE=P
Image Structure Metadata:
  COMPRESSION=JPEG
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  256.0)
Upper Right (  256.0,    0.0)
Lower Right (  256.0,  256.0)
Center      (  128.0,  128.0)
Band 1 Block=256x1 Type=Byte, ColorInterp=Red
Band 2 Block=256x1 Type=Byte, ColorInterp=Green
Band 3 Block=256x1 Type=Byte, ColorInterp=Blue


gdal_translate -of GTiff U_2001D.NTF U_2001D.TIF

ERROR 6: SetColorInterpretation() not supported for this dataset.
ERROR 6: SetColorInterpretation() not supported for this dataset.
ERROR 6: SetColorInterpretation() not supported for this dataset.
Input file size is 256, 256
0...10...20...30...40...50...60...70...80...90...100 - done.

comment:3 by Even Rouault, 17 years ago

Using gdal-1.4.2, I don't see any error while using gdalinfo, but I confirm for gdal_translate

comment:4 by warmerdam, 17 years ago

Component: defaultGDAL_Raster
Description: modified (diff)
Milestone: 1.5.0
Priority: highestnormal
Status: newassigned

This seems to be a GeoTIFF driver issue. I'll pursue that avenue.

comment:5 by Even Rouault, 17 years ago

This seems to have already been "fixed" in svn trunk in r11650. To be more precise, the call to poBand->SetColorInterpretation where poBand is a JPEG raster band (which doesn't support SetColorInterpreation) has been put inside the CPLPushErrorHandler( CPLQuietErrorHandler ) / CPLPopErrorHandler() pair. However, I'm wondering if it's really the right thing to do. IMHO, we should either add SetColorInterpretation implementation to the jpeg driver or delete the SetColorInterpretation lines.

comment:6 by warmerdam, 17 years ago

Keywords: NITF added
Resolution: fixed
Status: assignedclosed

Even,

The SetColorInterpretation() actually works when GDAL_PAM_ENABLED is true, since it is captured in the PAM layer. When that isn't enabled we prefer to just ignore error messages. It would likely be ideal for the jpeg layer to be able to capture this in some fashion, but I don't think the work is justified since I hope PAM to be enabled by default at some point in the future.

Note: See TracTickets for help on using tickets.