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

            set imagedatafile [open "C:/imagedata.txt" "w+"]
            fconfigure $imagedatafile -translation binary
            puts $imagedatafile [$theIm data -format jpeg]
            close $imagedatafile

            set fileName "C:/Winter.jpg"
            set fd [open $fileName r]
            fconfigure $fd -translation binary
            set imagebase64file [open "C:/imagebase64.txt" "w+"]
            fconfigure $imagebase64file -translation
            puts $imagebase64file [::base64::encode [read $fd]]
            close $fd
            close $imagebase64file

But I found the C:/imagedata.txt is very different from the C:/

anyone knows why this happen?


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