From e9d8a67bc15f8d973c67a5add0543be90f3a797a Mon Sep 17 00:00:00 2001 From: "dgp@users.sourceforge.net" Date: Tue, 5 May 2015 19:30:16 +0000 Subject: [3603436][06c3fcb136] Correction to earlier bugfix. When alpha values are all opaque, so that image format writers may use non-alpha supporting formats losslessly, make sure that message always gets back to the caller. --- generic/tkImgPhoto.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 58c4484..780b0c2 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -5648,6 +5648,9 @@ ImgGetPhoto( break; } } + if (!alphaOffset) { + blockPtr->offset[3]= -1; /* Tell caller alpha need not be read */ + } greenOffset = blockPtr->offset[1] - blockPtr->offset[0]; blueOffset = blockPtr->offset[2] - blockPtr->offset[0]; if (((optPtr->options & OPT_BACKGROUND) && alphaOffset) || @@ -5766,9 +5769,6 @@ ImgGetPhoto( blockPtr->offset[2]= 0; blockPtr->offset[3]= 1; } - if (!alphaOffset) { - blockPtr->offset[3]= -1; - } return data; } return NULL; -- cgit v0.12