Fix for recent "Convert to windows .ico format no longer inverts alpha channel." patch
Matthew Litwin <[email protected]> Mon, 12 Jan 2009 10:30:24 -0800
| Newsgroups | gmane.comp.video.image-magick.bugs |
|---|---|
| Message-ID | <[email protected]> |
I got this one wrong, in a way which busts conversion to .ico's when there is an alpha channel. I said: > So around line 997 where we have > > if (next->matte == MagickFalse) > *q++=ScaleQuantumToChar(255); > else > *q++=ScaleQuantumToChar(p->opacity); > > I think the last line should be > *q++=ScaleQuantumToChar(255 - p->opacity); but in fact it should be *q++=ScaleQuantumToChar(QuantumRange - p->opacity); 255 is of course a char value, but we are converting from a Quantum *to* a char. I've tested this change on some more real world examples. One thing I still don't understand, though, is the *q+ +=ScaleQuantumToChar(255) line, which seems like it should then be "*q++=ScaleQuantumToChar(QuantumRange)" Perhaps in the next->matte == MagickFalse, the particular value is unimportant, though I've not tested that. Sorry for the confusion! -Matt