1# This file is a Tcl script to test out GIF reading and writing. 2# It is organized in the standard fashion for Tcl tests. 3# 4 5if {[string compare test [info procs test]] == 1} { 6 source defs 7} 8 9set gifdata \ 10{R0lGODlhEAAMAJEAANnZ2QAAAPD/gP///yH5BAEAAAAALAAAAAAQAAwAAAIghINhyycvVFsB 11QtmS3rjaH1Hg141WaT5ouprt2HHcUgAAOw==} 12 13test gif-1.1 {} { 14 catch {image delete i} 15 image create photo i -file folder.gif 16} i 17test gif-1.2 {} { 18 catch {image delete i} 19 image create photo i -data $gifdata 20 i data -format gif 21} $gifdata 22test gif-1.3 {} { 23 catch {image delete i} 24 image create photo i 25 i put $gifdata 26 i data -format gif 27} $gifdata 28test gif-1.4 {} { 29 i blank 30 i put $gifdata -format gif 31 i data -format gif 32} $gifdata 33 34test gif-2.0 {Binary I/O with GIF images} { 35 i blank 36 set f [open folder.gif r] 37 fconfigure $f -translation binary 38 set return [catch {i put [read $f]} msg] 39 close $f 40 lappend return $msg 41} {0 {}} 42