blob: 94393e6585899559c35bb161c7c99f9599bbeaed (
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
# This file is a Tcl script to test out PPM reading and writing.
# It is organized in the standard fashion for Tcl tests.
#
puts "img::ppm [package require img::ppm]"
set ppmdata \
{UDYKODIgMTIKMjU1Ct/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b
39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b
39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b
39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b
39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b3wAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////wAAAP8A
AP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAAAAAAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/
AAAAAAAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAAAAD//wD//wD//wD//wD//wD//wD/
/wD//wD//wAAAP8A//8A//8A//8A//8A//8A//8A//8A//8A/wAAAP//AP//AP//AP//AP//
AP//AP//AP//AP//AAAAAN/b39/b3wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//
/////////////////////////////////wAAAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8A
AAAAAAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAAAAAAA/wAA/wAA/wAA/wAA/wAA/wAA
/wAA/wAA/wAAAAD//wD//wD//wD//wD//wD//wD//wD//wD//wAAAP8A//8A//8A//8A//8A
//8A//8A//8A//8A/wAAAP//AP//AP//AP//AP//AP//AP//AP//AP//AAAAAN/b39/b3wAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////////////
/wAAAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAAAAAAD/AAD/AAD/AAD/AAD/AAD/AAD/
AAD/AAD/AAAAAAAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAAAAD//wD//wD//wD//wD/
/wD//wD//wD//wD//wAAAP8A//8A//8A//8A//8A//8A//8A//8A//8A/wAAAP//AP//AP//
AP//AP//AP//AP//AP//AP//AAAAAN/b39/b3wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAP///////////////////////////////////wAAAP8AAP8AAP8AAP8AAP8AAP8AAP8A
AP8AAP8AAAAAAAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAAAAAAA/wAA/wAA/wAA/wAA
/wAA/wAA/wAA/wAA/wAAAAD//wD//wD//wD//wD//wD//wD//wD//wD//wAAAP8A//8A//8A
//8A//8A//8A//8A//8A//8A/wAAAP//AP//AP//AP//AP//AP//AP//AP//AP//AAAAAN/b
39/b3wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////////////
/////////wAAAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAAAAAAD/AAD/AAD/AAD/AAD/
AAD/AAD/AAD/AAD/AAAAAAAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAAAAD//wD//wD/
/wD//wD//wD//wD//wD//wD//wAAAP8A//8A//8A//8A//8A//8A//8A//8A//8A/wAAAP//
AP//AP//AP//AP//AP//AP//AP//AP//AAAAAN/b39/b3wAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAP///////////////////////////////////wAAAP8AAP8AAP8AAP8AAP8A
AP8AAP8AAP8AAP8AAAAAAAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAAAAAAA/wAA/wAA
/wAA/wAA/wAA/wAA/wAA/wAA/wAAAAD//wD//wD//wD//wD//wD//wD//wD//wD//wAAAP8A
//8A//8A//8A//8A//8A//8A//8A//8A/wAAAP//AP//AP//AP//AP//AP//AP//AP//AP//
AAAAAN/b39/b3wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////////////
/////////////////wAAAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAAAAAAD/AAD/AAD/
AAD/AAD/AAD/AAD/AAD/AAD/AAAAAAAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAAAAD/
/wD//wD//wD//wD//wD//wD//wD//wD//wAAAP8A//8A//8A//8A//8A//8A//8A//8A//8A
/wAAAP//AP//AP//AP//AP//AP//AP//AP//AP//AAAAAN/b39/b3wAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAP///////////////////////////////////wAAAP8AAP8AAP8A
AP8AAP8AAP8AAP8AAP8AAP8AAAAAAAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAAAAAAA
/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAAAAD//wD//wD//wD//wD//wD//wD//wD//wD/
/wAAAP8A//8A//8A//8A//8A//8A//8A//8A//8A/wAAAP//AP//AP//AP//AP//AP//AP//
AP//AP//AAAAAN/b39/b3wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP//////////
/////////////////////////wAAAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAP8AAAAAAAD/
AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAD/AAAAAAAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA/wAA
/wAAAAD//wD//wD//wD//wD//wD//wD//wD//wD//wAAAP8A//8A//8A//8A//8A//8A//8A
//8A//8A/wAAAP//AP//AP//AP//AP//AP//AP//AP//AP//AAAAAN/b39/b3wAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAN/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b
39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b
39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b
39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b
39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b39/b3w==}
test ppm-1.1 {} {
catch {image delete i}
image create photo i -file [file join $tcltest::testsDirectory hori_raw.ppm]
i data -format ppm
} $ppmdata
test ppm-1.2 {} {
catch {image delete i}
image create photo i -file [file join $tcltest::testsDirectory hori_ascii.ppm]
i data -format ppm
} $ppmdata
test ppm-1.3 {} {
catch {image delete i}
image create photo i -data $ppmdata
set data [i data -format ppm]
} $ppmdata
test ppm-1.4 {} {
i blank
i put $ppmdata
set data [i data -format ppm]
} $ppmdata
test ppm-1.5 {} {
i blank
i put $ppmdata -format ppm
set data [i data -format ppm]
} $ppmdata
if {[info tclversion] < 8.0} {
return
}
test ppm-2.0 {Binary I/O with PPM images} {
i blank
set f [open [file join $tcltest::testsDirectory hori_raw.ppm] r]
fconfigure $f -translation binary
set return [catch {i put [read $f]} msg]
close $f
lappend return $msg
} {0 {}}
|