PNGPixelRect can only handle Lum/RGB/RGBA [1/3/4 bpp] images for now
I'm migrating to JOGL2 from JOGL1 and I have the following problem.
I load a PNG into a bufferedimage and then use it as a texture
BufferedImage thumbNail=ImageIO.read(new File(localPath+catalogPath+path + txtName));
And I get this exception.
java.lang.RuntimeException: PNGPixelRect can only handle Lum/RGB/RGBA [1/3/4 bpp] images for now. BytesPerPixel 8
Is there a Workaround ? I cannot resave all my PNGs
I did not have this problem in JOGL1
Re: PNGPixelRect can only handle Lum/RGB/RGBA [1/3/4 bpp] images for now
You could modify the buffered image so that it uses a supported pixel format. Which kind of PNG do you use? "BytesPerPixel 8" is weird.
Edit.: You're probably using grayscale or truecolor PNGs with 2 bytes per sample. You can simply drop the least significant byte so that it uses 1 byte per sample, i.e 4 bytes per pixel which is supported by JOGL.