Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


jpeg image raw data from sql

jpeg image raw data from sql

jpeg image raw data from sql


I am using a java tool for test execution which stores the screen captures in SQL. The image is stored as raw data, am not sure about the format, may be base64. Am trying to write a wrapper in tcl to retrieve that data from SQL, build the image and store it in the local machine.

This is where i am,

package require Img
foreach file [glob *.jpg] {
set root [file rootname $file]
set image [image create photo -file $file]
foreach {format suffix} {JPEG jpg GIF gif PNG png} {
$image write $root.$suffix -format $format

This code takes an image as input and creates copies in other formats (jpg -> png, png -> jpg etc.,) But i need to pass the data stored in SQL which goes like this, "0xFFD8FFE000104A46494600010101006000600000FFDB0043000F0A0B0D0B090F0D0C0D11100F11162518161414162D20221B25352F3837342F34333B4255483B3F503F33344A644B50575A5F605F3947686F675C6E555D5F5BFFDB0043011011111613162B18182B5...." and so on for 1 image. I used the command, 'image create photo data <data>' but it doesn't work. I tried decoding, binary, hex conversion, but nothing works. Any help would be greatly appreciated.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close