diff options
author | dkf <dkf@noemail.net> | 2009-09-25 08:48:52 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2009-09-25 08:48:52 (GMT) |
commit | 3ffee373982ea32cf5257dd7ada0aa71756bde68 (patch) | |
tree | 5a95e83cfd6a065c9db0d329aed824abf767bd11 | |
parent | ca09559ddf68fe04722251266c73ded7d2bc0aee (diff) | |
download | tk-3ffee373982ea32cf5257dd7ada0aa71756bde68.zip tk-3ffee373982ea32cf5257dd7ada0aa71756bde68.tar.gz tk-3ffee373982ea32cf5257dd7ada0aa71756bde68.tar.bz2 |
Correct generation of grayscale data from an image. Reported by Keith Vetter
on comp.lang.tcl.
FossilOrigin-Name: 68c98f79970222b8bcc7eb53a773f938c4e4aa40
-rw-r--r-- | ChangeLog | 15 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 6 |
2 files changed, 13 insertions, 8 deletions
@@ -1,10 +1,15 @@ +2009-09-25 Donal K. Fellows <dkf@users.sf.net> + + * generic/tkImgPhoto.c (ImgGetPhoto): Correct generation of grayscale + data from an image. Reported by Keith Vetter on comp.lang.tcl. + 2009-09-14 Jeff Hobbs <jeffh@ActiveState.com> - * generic/tkMenuDraw.c (TkPostSubmenu): Fix reposting of submenu in - * win/tkWinMenu.c (TkWinHandleMenuEvent): torn off Windows menu. - [Bug 873613] - (DrawMenuEntryArrow): Draw Win menu arrow after being torn - off. [Bug 873608] + * generic/tkMenuDraw.c (TkPostSubmenu): [Bug 873613]: Fix reposting of + * win/tkWinMenu.c (TkWinHandleMenuEvent): submenu in torn off Windows + menu. + (DrawMenuEntryArrow): [Bug 873608]: Draw Win menu arrow after being + torn off. 2009-09-10 Donal K. Fellows <dkf@users.sf.net> diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 9ffbb3d..6e385a4 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -17,7 +17,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.76.2.3 2009/02/06 08:13:23 das Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.76.2.4 2009/09/25 08:48:53 dkf Exp $ */ #include "tkInt.h" @@ -5681,8 +5681,8 @@ ImgGetPhoto( } else if (optPtr->options & OPT_GRAYSCALE) { for (y = blockPtr->height; y > 0; y--) { for (x = blockPtr->width; x > 0; x--) { - *destPtr = (unsigned char) - (srcPtr[0]*11+srcPtr[1]*16+srcPtr[2]*5 + 16) >> 5; + *destPtr = (unsigned char) ((srcPtr[0]*11 + srcPtr[1]*16 + + srcPtr[2]*5 + 16) >> 5); srcPtr += blockPtr->pixelSize; destPtr += newPixelSize; } |