In the function ParseImagePattern() there has long been an error with
the use_index parsing.
image->Use = USE_INDEX; // Should be USE_NONE
Yes, the set up is strange, but USE_NONE means don't use the color
and/or alpha channels - but rather use the palette indexes. The other
image parsing options look to be correct setting USE_NONE on seeing
use_index. The parsing is set up with respect to what color channels to
use - so even defining USE_INDEX is odd. It's probably a remnant from
Aside 1 : The index handling is hard coded to 8 bits (0-255) which is
gif compatible and will work many png or tiff palette images, but png
supports options with fewer bits and the de-facto standard tiff can use
a 16 bit palette format.
Stick with 8 bit palettes would be the rule for use_index.
FWIW. I didn't test other than gif palette images.
In addition to some additional parse time checking for use_color,
use_alpha and use_index - I added an exception if someone attempts to
use use_index where none exists in the input image.
Aside 2: In a surprise to me, the use_alpha option uses the red channel
when it cannot find an actual alpha channel for the return values.
Post a reply to this message