I wrote "set theIm [image create photo -file "C:/Winter.jpg"]" to
create a photo
and I wrote following codes to get the photo's data by two ways
1.
set imagedatafile [open "C:/imagedata.txt" "w+"]
fconfigure $imagedatafile -translation binary
puts $imagedatafile [$theIm data -format jpeg]
close $imagedatafile
2.
set fileName "C:/Winter.jpg"
set fd [open $fileName r]
fconfigure $fd -translation binary
set imagebase64file [open "C:/imagebase64.txt" "w+"]
fconfigure $imagebase64file -translation
binary
puts $imagebase64file [::base64::encode [read $fd]]
close $fd
close $imagebase64file
But I found the C:/imagedata.txt is very different from the C:/
imagebase64.txt
anyone knows why this happen?
thanks