From de19fb37374b3b7404b0c03c92938655a8765ab1 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 3 Sep 2007 10:12:26 +0000 Subject: [PATCH] From Ralf Kern, "the attached color mapped TIFF file klink1_l.tif is incorrectly read as GL_LUMINANCE data instead of GL_RGB data. You can easily check with "osgViewer --image klink1_l.tif". The bug is in ReaderWriterTIFF.cpp function simage_tiff_load, where numComponents_ret is incorrectly set to 1 instead of 3 for color mapped data." --- src/osgPlugins/tiff/ReaderWriterTIFF.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/osgPlugins/tiff/ReaderWriterTIFF.cpp b/src/osgPlugins/tiff/ReaderWriterTIFF.cpp index a6a0bf4aa..cb9a01d76 100644 --- a/src/osgPlugins/tiff/ReaderWriterTIFF.cpp +++ b/src/osgPlugins/tiff/ReaderWriterTIFF.cpp @@ -616,7 +616,11 @@ simage_tiff_load(std::istream& fin, } width_ret = width; height_ret = height; - numComponents_ret = samplesperpixel; + if (photometric == PHOTOMETRIC_PALETTE) + numComponents_ret = format; + else + numComponents_ret = samplesperpixel; + return buffer; }