[QGIS-trac] Re: [Quantum GIS] #996: Re: [Quantum GIS] #996: QGIS corrupts JPEG2000 colors

Quantum GIS qgis at qgis.org
Wed Dec 10 14:09:46 EST 2008


#996: Re: [Quantum GIS] #996: QGIS corrupts JPEG2000 colors
-----------------------------------------------------+----------------------
        Reporter:  coatman                           |         Owner:  nobody       
            Type:  defect                            |        Status:  reopened     
        Priority:  major: does not work as expected  |     Milestone:  Version 1.0.1
       Component:  Rasters                           |       Version:  HEAD         
      Resolution:                                    |      Keywords:  kakadu raster
Platform_version:                                    |      Platform:  OS X         
        Must_fix:  No                                |   Status_info:  0            
-----------------------------------------------------+----------------------
Comment (by Coatman):

 Doing a Unix diff on frmts/jp2kak/jp2kakdataset.cpp for gdal-1.6.0 (a
 version of GDAL that I think is displaying altered colors for JP2 images
 with JP2KAK) versus gdal-1.5.0 (a version of GDAL that I think properly
 displayed colors in JP2 images with JP2KAK), I notice that in the section
 following the line 312 comment "Figure out the color interpretation for
 this band." gdal-1.5.0 provides two possibilities
         if( oJP2Channels.get_num_colours() == 3 )
         {
 #ifdef KAKADU41
             oJP2Channels.get_colour_mapping( 0, nRedIndex, nLutIndex, nCSI
 );
             oJP2Channels.get_colour_mapping( 1, nGreenIndex, nLutIndex,
 nCSI );
             oJP2Channels.get_colour_mapping( 2, nBlueIndex, nLutIndex,
 nCSI );
 #else
             oJP2Channels.get_colour_mapping( 0, nRedIndex, nLutIndex );
             oJP2Channels.get_colour_mapping( 1, nGreenIndex, nLutIndex );
             oJP2Channels.get_colour_mapping( 2, nBlueIndex, nLutIndex );
 #endif

 while gdal-1.6.0 provides only one possibility
         if( oJP2Channels.get_num_colours() == 3 )
         {
             oJP2Channels.get_colour_mapping( 0, nRedIndex, nLutIndex, nCSI
 );
             oJP2Channels.get_colour_mapping( 1, nGreenIndex, nLutIndex,
 nCSI );
             oJP2Channels.get_colour_mapping( 2, nBlueIndex, nLutIndex,
 nCSI );

 Since what I see as a result of QGIS displaying a JP2 image with JP2KAK,
 is an image with the proper number of columns, and proper number of rows,
 but with the colors altered as through they are being run through a color
 Look Up Table or Lut, I thought this observation worth reporting.

-- 
Ticket URL: <http://trac.osgeo.org/qgis/ticket/996#comment:41>
Quantum GIS <http://qgis.org>
Quantum GIS is an Open Source GIS viewer/editor supporting OGR, PostGIS, and GRASS formats


More information about the QGIS-trac mailing list