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."
This commit is contained in:
Robert Osfield
2006-02-20 20:06:26 +00:00
parent af6af82e56
commit b0358c698a

View File

@@ -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;