#!/bin/sh
# the next line restarts using tclsh \
exec wish "$0" "$@"

package require base64
set arg1 [lindex $argv 0]

if {![file exists $arg1.gif]} {
	puts "No $arg1.gif. Exitting"
	exit
}

set f [open $arg1.gif r]
fconfigure $f  -translation binary
string length  [set data [read $f]]
set g [base64::encode "$data"]

set out [open $arg1.64 w]

puts -nonewline  $out "$g"
close $out

# pack [button .b -command {exit} -image [image create photo i -data "$g"]]
exit
