diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2009-09-25 08:46:07 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2009-09-25 08:46:07 (GMT) |
commit | 15cfea56bc85d5b5b7a44fbc46f54e8c9d32b959 (patch) | |
tree | 2967de3fd96b6abd4210437a0f1e7520e936946b | |
parent | edff204f863b5527369a1ca046d40240fe45754d (diff) | |
download | tk-15cfea56bc85d5b5b7a44fbc46f54e8c9d32b959.zip tk-15cfea56bc85d5b5b7a44fbc46f54e8c9d32b959.tar.gz tk-15cfea56bc85d5b5b7a44fbc46f54e8c9d32b959.tar.bz2 |
Correct generation of grayscale data from an image. Reported by Keith Vetter
on comp.lang.tcl.
-rw-r--r-- | ChangeLog | 22 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 6 |
2 files changed, 16 insertions, 12 deletions
@@ -1,17 +1,21 @@ +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-19 Peter Spjuth <peter.spjuth@gmail.com> - * generic/tkGrid.c - * generic/tkPack.c - * tests/packgrid.test: Bug fix in grid/pack collision detect. - Faulty slave was not properly blocked from slave list. [Bug 2859912] + * generic/tkGrid.c: [Bug 2859912]: Bug fix in grid/pack collision + * generic/tkPack.c: detect. Faulty slave was not properly blocked + * tests/packgrid.test: from slave list. 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-09 Donal K. Fellows <dkf@users.sf.net> diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 545e768..f133de2 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.91 2009/01/19 14:00:06 das Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.92 2009/09/25 08:46:07 dkf Exp $ */ #include "tkImgPhoto.h" @@ -3587,8 +3587,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; } |