I am fetching data from MSSQL database and trying to convert it to picture and show on website. I have tried a few different tricks but none seem to work. So I am hoping some one would be kind enough to help me out.
The database image is too large to be shown here, but here is a clip (it was stored as varbinary(MAX) in DB) ):
$kuva = 0xFFD8FFE000104A46494600010101004800480000FFE138724578696600004D4D002A00000008000C010E0002000000200000
I assumed that it was base64 and have tried the following
> echo '<img src="data:image/jpg;base64,='.base64_encode("0xFFD8FFE000104A46494600010101004800480000FFE1365E4578696600004D4D002A00000008000C010E000200000020000008AA010F000200000005000008CA0110000200000009000008D00112000300000001000100000");
<img src="data:image/jpeg;base64,<?php echo base64_encode($kuva);?>" />
header("Content-type: image/jpg");
echo base64_encode($kuva);
echo base64_encode($kuva);
echo base64_decode($kuva);
However I can not seem to find either the right format (png, gif, jpg, jpeg) or I would have to decode/encode it with something else than base64.
I know that this site is full of anwers on this topic, but so far nothing has worked. If anyone knows the answer it would be greatly apreciated or can point out some website/program that can actually identify the code and allow it to be type juggled to a format that can be saved as image.
Thanks in advance!