Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jpeg image raw data from sql

Status
Not open for further replies.

smadhubala

Programmer
Dec 17, 2014
1
US
All,

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.

Thanks,
Madhubala.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top