From b0358c698acce656e534f30dbef1a793101138a2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 20 Feb 2006 20:06:26 +0000 Subject: [PATCH] From Eric Sokolowsky, "There was a problem with the PNG plugin when it encounters an image that is less than 8 bits per pixel (this can happen with greyscale or paletted images). It was a pretty simple problem to fix." --- src/osgPlugins/png/ReaderWriterPNG.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osgPlugins/png/ReaderWriterPNG.cpp b/src/osgPlugins/png/ReaderWriterPNG.cpp index a21e84169..ecf76b981 100644 --- a/src/osgPlugins/png/ReaderWriterPNG.cpp +++ b/src/osgPlugins/png/ReaderWriterPNG.cpp @@ -152,7 +152,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter png_read_end(png, endinfo); GLenum pixelFormat = 0; - GLenum dataType = depth==8?GL_UNSIGNED_BYTE:GL_UNSIGNED_SHORT; + GLenum dataType = depth<=8?GL_UNSIGNED_BYTE:GL_UNSIGNED_SHORT; switch(color) { case(PNG_SOLID): pixelFormat = GL_LUMINANCE; break;