Skip to content
Permalink
Browse files
Ignoring color ramps from 0.0 to 0.0 to be able to draw malformed TIF…
…Fs. Fixes #643

git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6794 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
homann committed Mar 11, 2007
1 parent a171307 commit 8db6a9766237aa202c1bb30b56f0a6cf0ab167e4
Showing with 13 additions and 4 deletions.
  1. +13 −4 src/raster/qgsrasterlayer.cpp
@@ -4441,10 +4441,13 @@ void QgsRasterLayer::readColorTable ( GDALRasterBand *gdalBand, QgsColorTable *t
{
continue;
}
theColorTable->add ( min, max,
(unsigned char)min_c1, (unsigned char)min_c2, (unsigned char)min_c3, 0,
(unsigned char)max_c1, (unsigned char)max_c2, (unsigned char)max_c3, 0 );
found = true;
if ( (min > 0.0) || (max > 0.0) ) { // A quick hack for malformed GDALMetadata
theColorTable->add ( min, max,
(unsigned char)min_c1, (unsigned char)min_c2, (unsigned char)min_c3, 0,
(unsigned char)max_c1, (unsigned char)max_c2, (unsigned char)max_c3, 0 );
found = true;
}

}
++metadata;
}
@@ -4514,6 +4517,12 @@ void *QgsRasterLayer::readData ( GDALRasterBand *gdalBand, QgsRasterViewPort *vi
viewPort->drawableAreaXDimInt,
viewPort->drawableAreaYDimInt,
type, 0, 0 );
if (myErr != CPLE_None)
{
// Couldn't read the raster, print the reason on debug.
// We should notify the user somehow
QgsDebugMsg("RasterIO failed and returned (see cpl_error.h) : " + QString::number(myErr));
}

}
return data;

0 comments on commit 8db6a97

Please sign in to comment.