- // If the image is of type wxPCX_8BIT, then there is a
- // palette at the end of the file. Read it now before
- // proceeding.
- //
- if (format == wxPCX_8BIT)
- {
- pos = stream.TellI();
- stream.SeekI(-769, wxFromEnd);
-
- if (stream.GetC() != 12)
- return wxPCX_INVFORMAT;
+ // If the image is of type wxPCX_8BIT, then there is
+ // a palette at the end of the image data. If we were
+ // working with a file, we could seek at the end to the
+ // end (SeekI(-769, wxFromEnd) and read the palette
+ // before proceeding. Unfortunately, this would prevent
+ // loading several PCXs in a single stream, so we can't
+ // do it. Thus, 8-bit images will have to be decoded in
+ // two passes: one to read and decode the image data,
+ // and another to replace 'colour indexes' with RGB
+ // values.