Assertion Error - Texture Load

Sometimes I get the assertion error below when loading textures given to me by my graphic artist, which are coming from PhotoShop. I usually get the error with JPEG images, but I’m not certain that it only happens with them. To solve this issue, all I have to do is open the image with another image editing program (GIMP, Paint.NET) and re-save the image.

This is using Panda 1.7.0 on Windows.

Assertion failed: _cinfo.output_components == 1 || _cinfo.output_components == 3
 at line 372 of c:\panda3d-1.7.0\panda\src\pnmimagetypes\
:gobj(error): Texture::read() - couldn't read: /c/Users/Path/To/Image/image.jpg

I would appreciate any help in trying to understand what’s happening here. Thanks.

The assertion is insisting that the JPEG file is either grayscale (1 channel) or color (3 channels). Since JPEG doesn’t support alpha, no other number of channels should be possible.

It appears that Photoshop is stretching the conventional JPEG format by adding an additional channel or two in there, and our reader isn’t prepared to handle that.


Excellent info. Thanks.