Bug report #914
8 bit paletted geotif tries to render as 3 band color. Crash on Load Min Max
Status: | Closed | ||
---|---|---|---|
Priority: | Low | ||
Assignee: | ersts - | ||
Category: | Rasters | ||
Affected QGIS version: | Regression?: | No | |
Operating System: | Debian | Easy fix?: | No |
Pull Request or Patch supplied: | Resolution: | fixed | |
Crashes QGIS or corrupts data: | Copied to github as #: | 10973 |
Description
According to the Raster Layer Properties, my 8 bit paletted geotif will be rendered as a 3 band color, which is not correct. It should be treated like a grayscale image with a custom color table based on the rasters palette.
I also wanted to report that you can also click on Load Min Max From Band(s), which promptly crashes qgis with the message:
Debug: /home/bobm/src/gis/qgis_svn/src/core/qgsmaplayer.cpp: 106: (name) [[QgsMapLayer]]::name: returning name 'LQ_agw_idx' Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 1284: (draw) [[QgsRasterLayer]]::draw (3 arguments) Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 1942: (drawPalettedMultiBandColor) [[QgsRasterLayer]]::drawPalettedMultiBandColor called Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 4112: (readData) [[QgsRasterLayer]]::readData: calling [[RasterIO]] with , source NW corner: 0, 0, source size: 2173, 2806, dest size: 120, 120 Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 5283: (paintImageToCanvas) [[QgsRasterLayer]]::drawSingleBandGray: painting image to canvas from 0, 0 to 0, 0. Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 2889: (getLegendQPixmap) [[QgsRasterLayer]]::getLegendQPixmap called (PALETTED_MULTI_BAND_COLOR) Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 932: (getPaletteAsPixmap) [[QgsRasterLayer]]::getPaletteAsPixmap Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 874: (hasBand) Looking for band : Palette Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 881: (hasBand) band = 1 Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 887: (hasBand) band = 1 Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 941: (getPaletteAsPixmap) ....found paletted image Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 946: (getPaletteAsPixmap) ....found GCI_PaletteIndex Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 949: (getPaletteAsPixmap) myMin = 0 myMax = 255 Debug: /home/bobm/src/gis/qgis_svn/src/app/qgsrasterlayerproperties.cpp: 782: (sync) [[QgsRasterLayerProperties]]::sync populate metadata tab Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 3557: (getMetadata) band 1 has no categories Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 3719: (getMetadata) Raster properties : checking if band 1 has stats? Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 3738: (getMetadata) .....no Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 2310: (getRasterBandNumber) myRasterBandStats.bandName: 1 : Palette :: theBandNameQString: Red Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 2320: (getRasterBandNumber) ********** no band was found in getRasterBandNumber Red Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 2310: (getRasterBandNumber) myRasterBandStats.bandName: 1 : Palette :: theBandNameQString: Red Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 2320: (getRasterBandNumber) ********** no band was found in getRasterBandNumber Red Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgscolortable.cpp: 40: (QgsColorTable) [[QgsColorTable]]::QgsColorTable() Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 2310: (getRasterBandNumber) myRasterBandStats.bandName: 1 : Palette :: theBandNameQString: Red Debug: /home/bobm/src/gis/qgis_svn/src/core/raster/qgsrasterlayer.cpp: 2320: (getRasterBandNumber) ********** no band was found in getRasterBandNumber Red Fatal: ASSERT failure in QList<T>::operator[]: "index out of range", file /usr/include/qt4/QtCore/qlist.h, line 394 Aborted
History
#1 Updated by ersts - almost 17 years ago
The crash has been taken care of.
I am going to leave this ticket open, because now that there is a shader class and color ramp shader , all paletted images can and should be display as cgs_bob indicates. This however is not going to make it into 0.9.2.
I am also downgrading the Priority as the crash has been taken care of.
#2 Updated by ersts - about 16 years ago
- Resolution set to fixed
- Status changed from Open to Closed
Paletted images no longer open as faux RGB but as single band images with a colormap.
Need more testing
#3 Updated by Anonymous about 15 years ago
Milestone Version 1.0.0 deleted