Opened 14 years ago

Closed 14 years ago

#3531 closed defect (fixed)

Data is different depending on which band is requested

Reported by: gbriggs Owned by: warmerdam
Priority: normal Milestone:
Component: GDAL_Raster Version: svn-trunk
Severity: normal Keywords: JPIP JPIPKAK JPEG2000
Cc:

Description

The following two commands give completely different data results for band 2 (the only band in the first case, and the middle band in the second):

gdal_translate.exe -of ENVI -b 2 -srcwin 27200 6450 501 451 jpip://216.150.195.220/JP2Server/Boulder_Foothills "C:\tmp\test_server_gdal_band2.img"

gdal_translate.exe -of ENVI -srcwin 27200 6450 501 451 jpip://216.150.195.220/JP2Server/Boulder_Foothills "C:\tmp\test_server_gdal_all_bands.img"

If you replace the -b 2 with -b 1, the results appear fine.

Change History (4)

in reply to:  description comment:1 by gbriggs, 14 years ago

Replying to gbriggs:

The following two commands give completely different data results for band 2 (the only band in the first case, and the middle band in the second):

gdal_translate.exe -of ENVI -b 2 -srcwin 27200 6450 501 451 jpip://216.150.195.220/JP2Server/Boulder_Foothills "C:\tmp\test_server_gdal_band2.img"

gdal_translate.exe -of ENVI -srcwin 27200 6450 501 451 jpip://216.150.195.220/JP2Server/Boulder_Foothills "C:\tmp\test_server_gdal_all_bands.img"

If you replace the -b 2 with -b 1, the results appear fine.

I suspect this issue may be related to the fact that the region decompressor being utilized by JPIPKAK performs color conversions automatically. But I have not confirmed this.

comment:2 by warmerdam, 14 years ago

Status: newassigned

I have had no problem reproducing serious issues with the situation described above.

comment:3 by warmerdam, 14 years ago

The problem seems to be particular to handling of YCbCr images. Boulder_Foothills uses YCbCr as the underlying color space. If three bands are requested at once things are automatically transformed to RGB by the region decompressor. But if you request just band 2 then you get the "Cb" component which does not look like much.

Note that requesting band 1 was not *really* working - it is just that the Y component (intensity) is similar in appearance to any of the red, green or blue channel results.

I *think* the solution is to ensure that all components are fetched from the JPIP server for YCC color model images. I'm going to try this out.

comment:4 by warmerdam, 14 years ago

Resolution: fixed
Status: assignedclosed

This strategy has been implemented in trunk (r19426) and appears to be working properly.

Note: See TracTickets for help on using tickets.