Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

TCL(Tool Command Language) Scripting

problem of the difference between "photo data" and "base64::encode"


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

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc