summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/tkImgPNG.c4
-rw-r--r--tests/imgPhoto.test16
2 files changed, 10 insertions, 10 deletions
diff --git a/generic/tkImgPNG.c b/generic/tkImgPNG.c
index c44c7fe..fccb465 100644
--- a/generic/tkImgPNG.c
+++ b/generic/tkImgPNG.c
@@ -2488,8 +2488,8 @@ DecodePNG(
* to negative here: Tk will not shrink the image.
*/
- if (Tk_PhotoExpand(interp, imageHandle, destX + pngPtr->block.width,
- destY + pngPtr->block.height) == TCL_ERROR) {
+ if (Tk_PhotoExpand(interp, imageHandle, destX + width,
+ destY + height) == TCL_ERROR) {
return TCL_ERROR;
}
diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test
index f6ed988..43f487f 100644
--- a/tests/imgPhoto.test
+++ b/tests/imgPhoto.test
@@ -1429,40 +1429,40 @@ test imgPhoto-19.1 {Read GIF file with -from option - Bug [1576528]} -body {
set earthPhotoFile [file join [file dirname [info script]] earth.gif]
image create photo gif1
gif1 read $earthPhotoFile -from 152 62 185 97
- lindex [lindex [gif1 data] 0] 0
+ list [lindex [lindex [gif1 data] 0] 0] [image width gif1] [image height gif1]
} -cleanup {
catch {image delete gif1}
unset earthPhotoFile
-} -result {#d8c8b8}
+} -result {{#d8c8b8} 33 35}
test imgPhoto-19.2 {Read GIF file, copy with -from option} -body {
set earthPhotoFile [file join [file dirname [info script]] earth.gif]
image create photo gif1 -file $earthPhotoFile
image create photo gif2
gif2 copy gif1 -from 152 62 185 97
- lindex [lindex [gif2 data] 0] 0
+ list [lindex [lindex [gif2 data] 0] 0] [image width gif2] [image height gif2]
} -cleanup {
catch {image delete gif1 ; image delete gif2}
unset earthPhotoFile
-} -result {#d8c8b8}
+} -result {{#d8c8b8} 33 35}
test imgPhoto-19.3 {Read PNG file with -from option - Bug [1576528]} -body {
set ousterPhotoFile [file join [file dirname [info script]] ouster.png]
image create photo png1
png1 read $ousterPhotoFile -from 102 62 135 97
- lindex [lindex [png1 data] 0] 0
+ list [lindex [lindex [png1 data] 0] 0] [image width png1] [image height png1]
} -cleanup {
catch {image delete png1}
unset ousterPhotoFile
-} -result {#c97962}
+} -result {{#c97962} 33 35}
test imgPhoto-19.4 {Read PNG file, copy with -from option} -body {
set ousterPhotoFile [file join [file dirname [info script]] ouster.png]
image create photo png1 -file $ousterPhotoFile
image create photo png2
png2 copy png1 -from 102 62 135 97
- lindex [lindex [png2 data] 0] 0
+ list [lindex [lindex [png2 data] 0] 0] [image width png2] [image height png2]
} -cleanup {
catch {image delete png1 ; image delete png2}
unset ousterPhotoFile
-} -result {#c97962}
+} -result {{#c97962} 33 35}
catch {rename foreachPixel {}}
catch {rename checkImgTrans {}}