Original Post
I''m writing PCX support for an OpenGL game engine that i''m working on. I read/decode/display version 5 PCX files with 8bits per pixle plus a 256 color palette or 24 bits per pixle with no palette.
This works completely fine for PCXs with a width that is even. I resized two of my test images to have an odd width with Gimp(one 24 bit, one 8 bit w/ palette), but the bytes per line field in the header says the bytes per line is an odd number, which violates the specification. From what I understand the end of each scanline should be padded with extra bytes to make the scanline have an even lenght. I tried going by the line length reported in the header, and this does not display correctly. I try assuming that it is the next even number, and I ignore the padding at the end of each scanline, but I run out of data before the entire image buffer is full, so obviously the padding is not there.
Can someone explain to me how I''m supposed to read these in? My code works 100% for images with even widths, and I wrote code, which I though would handle odd widthed images according to the PCX specification, but it does not appear to work.