summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tkImgPhoto.c11
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;
}