Jonathan Osuch wrote:
Gerald wrote:
Line 143: planes = (buffer[10] & 0x0F) + 1;
Line 263: planes = (buffer[8] & 0x0F) + 1;
[...]
I'm not the GIF guru, so I have no idea what you are talking about. Do you mean to say we should use 0xFF (or 0x1F) instead of 0x0F? Or is it something else?
No, it should be 0x07. In both cases (line 143 and 263) the information about the palette size is contained in the 3 least significant bits, everything else contains other information - but doing "byte & 0x0F" reads out the lowest 4 bits, one too many. However, as I wrote in my original post, it is nearly a non-issue, because in one case (line 263) this additional bit is not used (reserved), and in the other case (line 143)this bit, if set, signifies a so called ordered palette - one would have to load a GIF produced by software which does exactly this to experience a problem. In closing, apologies for creating such Shakespearean "much ado about nothing", I really didn't intend to :-) Regards, Gerald