diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-10-28 09:54:25 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2013-10-28 09:54:25 (GMT) |
commit | 975dc4a26d2d686c80b5f06ef0f218e5e8051503 (patch) | |
tree | 5c9c8e5709b914c9565a6ba1ac1f3507e8440677 /generic/tkImgPhoto.c | |
parent | 81e6afdd4e6735140c946e30298285ea8d33fdc8 (diff) | |
parent | 85289793bcef6cb95dad1879cb483f5128be9d27 (diff) | |
download | tk-975dc4a26d2d686c80b5f06ef0f218e5e8051503.zip tk-975dc4a26d2d686c80b5f06ef0f218e5e8051503.tar.gz tk-975dc4a26d2d686c80b5f06ef0f218e5e8051503.tar.bz2 |
Fix [3603436fff]: png save has wrong component indexes
Diffstat (limited to 'generic/tkImgPhoto.c')
-rw-r--r-- | generic/tkImgPhoto.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 4fcc3db..9527c93 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -3683,12 +3683,6 @@ ImgGetPhoto( break; } } - if (!alphaOffset) { - blockPtr->pixelPtr--; - blockPtr->offset[0]++; - blockPtr->offset[1]++; - blockPtr->offset[2]++; - } greenOffset = blockPtr->offset[1] - blockPtr->offset[0]; blueOffset = blockPtr->offset[2] - blockPtr->offset[0]; if (((optPtr->options & OPT_BACKGROUND) && alphaOffset) || @@ -3803,9 +3797,14 @@ ImgGetPhoto( if (newPixelSize > 2) { blockPtr->offset[1] = 1; blockPtr->offset[2] = 2; + blockPtr->offset[3]= 3; } else { blockPtr->offset[1] = 0; blockPtr->offset[2] = 0; + blockPtr->offset[3]= 1; + } + if (!alphaOffset) { + blockPtr->offset[3]= -1; } return data; } |