blob: 302cf604ff870b5321bf41cc89c42b23d6cc061b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# This file is a Tcl script to test out GIF reading and writing.
# It is organized in the standard fashion for Tcl tests.
#
puts "img::gif [package require img::gif]"
set gifdata \
{R0lGODlhEAAMAJEAANnZ2f///wAAAPD/gCH5BAEAAAAALAAAAAAQAAwAAAIghIViyzc/VFsC
QtmS3rjaH1Hg141WaT5ouprt2HHcUgAAOw==}
test gif-1.1 {} {
catch {image delete i}
image create photo i -file [file join $tcltest::testsDirectory folder.gif]
} i
test gif-1.2 {} {
catch {image delete i}
image create photo i -data $gifdata
i data -format gif
} $gifdata
test gif-1.3 {} {
catch {image delete i}
image create photo i
i put $gifdata
i data -format gif
} $gifdata
test gif-1.4 {} {
i blank
i put $gifdata -format gif
i data -format gif
} $gifdata
if {[info tclversion] < 8.0} {
return
}
test gif-2.0 {Binary I/O with GIF images} {
i blank
set f [open [file join $tcltest::testsDirectory folder.gif] r]
fconfigure $f -translation binary
set return [catch {i put [read $f]} msg]
close $f
lappend return $msg
} {0 {}}
|