diff options
author | fvogel <fvogelnew1@free.fr> | 2024-06-08 20:58:57 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2024-06-08 20:58:57 (GMT) |
commit | ac4a3d5ccfb8d411352a169e6e3ad3fb3bdd6f94 (patch) | |
tree | 1b0cd623d0d710eb93a740733b6f01f0ec953ce2 /tests | |
parent | cba533255d5353b806f6c3369b3bd6dcb060269d (diff) | |
download | tk-ac4a3d5ccfb8d411352a169e6e3ad3fb3bdd6f94.zip tk-ac4a3d5ccfb8d411352a169e6e3ad3fb3bdd6f94.tar.gz tk-ac4a3d5ccfb8d411352a169e6e3ad3fb3bdd6f94.tar.bz2 |
Add test imgPhoto-19.3 demonstrating bug [1576528] for the PNG case, and imgPhoto-19.4 (which shows a workaround and passes).
Diffstat (limited to 'tests')
-rw-r--r-- | tests/constraints.tcl | 4 | ||||
-rw-r--r-- | tests/imgPhoto.test | 15 | ||||
-rw-r--r-- | tests/ouster.png | bin | 0 -> 54257 bytes |
3 files changed, 18 insertions, 1 deletions
diff --git a/tests/constraints.tcl b/tests/constraints.tcl index 22bc52d..1087d25 100644 --- a/tests/constraints.tcl +++ b/tests/constraints.tcl @@ -296,9 +296,11 @@ testConstraint testtext [llength [info commands testtext]] testConstraint testwinevent [llength [info commands testwinevent]] testConstraint testwrapper [llength [info commands testwrapper]] -# the earth.gif file is used in some tests +# Some graphic files used in some tests set earthPhotoFile [file join [file dirname [info script]] earth.gif] testConstraint hasEarthPhoto [file exists $earthPhotoFile] +set ousterPhotoFile [file join [file dirname [info script]] ouster.png] +testConstraint hasOusterPhoto [file exists $ousterPhotoFile] # constraints about what sort of fonts are available testConstraint fonts 1 diff --git a/tests/imgPhoto.test b/tests/imgPhoto.test index 54294b9..78ddcd7 100644 --- a/tests/imgPhoto.test +++ b/tests/imgPhoto.test @@ -1440,6 +1440,21 @@ test imgPhoto-19.2 {Read GIF file, copy with -from option} -constraints hasEarth } -cleanup { catch {image delete gif1 ; image delete gif2} } -result {#d8c8b8} +test imgPhoto-19.3 {Read PNG file with -from option - Bug [1576528]} -constraints hasOusterPhoto -body { + image create photo png1 + png1 read $ousterPhotoFile -from 102 62 135 97 + lindex [lindex [png1 data] 0] 0 +} -cleanup { + catch {image delete png1} +} -result {#c97962} +test imgPhoto-19.4 {Read PNG file, copy with -from option} -constraints hasOusterPhoto -body { + image create photo png1 -file $ousterPhotoFile + image create photo png2 + png2 copy png1 -from 102 62 135 97 + lindex [lindex [png2 data] 0] 0 +} -cleanup { + catch {image delete png1 ; image delete png2} +} -result {#c97962} catch {rename foreachPixel {}} catch {rename checkImgTrans {}} diff --git a/tests/ouster.png b/tests/ouster.png Binary files differnew file mode 100644 index 0000000..259b8f9 --- /dev/null +++ b/tests/ouster.png |