diff options
author | dgp <dgp@users.sourceforge.net> | 2015-05-05 19:38:12 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2015-05-05 19:38:12 (GMT) |
commit | 292efe2ce7dea6f9212142f9ae7c3a91b181ed82 (patch) | |
tree | c3e41a4c66546f44f48d553fbf447659aa824e28 /generic/tkImgPhoto.c | |
parent | ce18ffa03b18639aaf9ce7f7aeb247cce6907bcd (diff) | |
parent | 878bf291bf4d13c72b0ca1ef98951b83c9382eaf (diff) | |
download | tk-292efe2ce7dea6f9212142f9ae7c3a91b181ed82.zip tk-292efe2ce7dea6f9212142f9ae7c3a91b181ed82.tar.gz tk-292efe2ce7dea6f9212142f9ae7c3a91b181ed82.tar.bz2 |
[06c3fcb136] ImgGetPhoto() had some code misplaced in an earlier commit
so that it failed to tell all callers when the alpha channel was fully opaque.
This triggered another bug in the PNG writer where the alpha vs. non-alpha
format choice was broken and confused, leading to corrupt png image files.
Diffstat (limited to 'generic/tkImgPhoto.c')
-rw-r--r-- | generic/tkImgPhoto.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 9527c93..63e2fa8 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -3683,6 +3683,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) || @@ -3803,9 +3806,6 @@ ImgGetPhoto( blockPtr->offset[2] = 0; blockPtr->offset[3]= 1; } - if (!alphaOffset) { - blockPtr->offset[3]= -1; - } return data; } return NULL; |