summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-28 09:52:53 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-10-28 09:52:53 (GMT)
commit85289793bcef6cb95dad1879cb483f5128be9d27 (patch)
tree0889d4786d81085536af9d10285d96908a61b4fe /generic
parentdbd21c81110eb1873d468a17c5061e6d4310e61a (diff)
downloadtk-85289793bcef6cb95dad1879cb483f5128be9d27.zip
tk-85289793bcef6cb95dad1879cb483f5128be9d27.tar.gz
tk-85289793bcef6cb95dad1879cb483f5128be9d27.tar.bz2
Fix [3603436fff]: png save has wrong component indexes
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 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;
}