blob: 1b010c2a07a166a9bb24cca52860f2bdbb1c2dcc (
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
|
# This file is a Tcl script to test out GIF reading and writing.
# It is organized in the standard fashion for Tcl tests.
#
if {[string compare test [info procs test]] == 1} {
source defs
}
set jpegdata \
{/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRof
Hh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwh
MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAAR
CAAMABADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAA
AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK
FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWG
h4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl
5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREA
AgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYk
NOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE
hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcb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m6wsPExcbHyMnK0tPU1dbX2Nna4uPk
5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwDpdJ8Nah4g0ay1q9n0Se7vrdLkTT6VI80A
dQypHILgFAmcKU2nI3feJY7Foda07WrHS9T1C0v0nsZpfOis2gk3xNCuW/eMpz5pJwByOPSv
FdP+NviXR9KsNNgstJeK2to4UeSKQttVQBnEgGcD0rsPh3481Xx343I1OCzh+xadcGP7KjLn
dJBnO5m/uDpjvXFRhinW95+67/1sF0f/2Q==}
catch {image delete i}
test jpeg-1.1 {} {
image create photo i -file folder.jpg
i data -format jpeg
} $jpegdata
test jpeg-1.2 {} {
image delete i
image create photo i -data $jpegdata
set data [i data -format jpeg]
} $jpegdata2
test jpeg-1.3 {} {
i blank
i put $jpegdata
set data [i data -format jpeg]
} $jpegdata2
test jpeg-1.4 {} {
i blank
i put $jpegdata -format jpeg
set data [i data -format jpeg]
} $jpegdata2
if {[info tclversion] < 8.0} {
return
}
test jpeg-2.0 {Binary I/O with JPEG images} {
i blank
set f [open folder.jpg r]
fconfigure $f -translation binary
set return [catch {i put [read $f]} msg]
close $f
lappend return $msg
} {0 {}}
|