summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPhoto.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkImgPhoto.c')
-rw-r--r--generic/tkImgPhoto.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 85c7de5..58c4484 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -5648,12 +5648,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) ||
@@ -5766,9 +5760,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;
}