php convert string(stream) to image - php
I using php 5.6.
And Get Json Data to Delphi Datasnap Middleware.
Here is Data Sample
71,73,70,56,57,97,211,1,60,0,85,0,0,33,249,4,1,0,0,47,0,44,0,0,0,0,211,1,60,0,133,255,255,255,0,0,0,153,102,0,102,204,255,102,153,255,255,255,204,102,51,51,255,204,102,153,255,255,255,255,153,255,153,102,204,255,255,51,102,204,0,102,153,204,102,51,102,0,102,102,51,0,0,0,102,51,51,102,102,0,0,0,0,51,0,51,102,51,0,0,51,0,102,102,102,102,102,0,51,153,102,51,51,0,51,102,51,102,102,102,153,153,255,153,51,102,153,204,102,102,153,204,102,102,102,204,204,153,153,0,102,102,153,102,102,0,51,51,51,51,51,51,102,102,102,204,204,204,204,255,153,153,102,204,255,153,102,102,0,153,153,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,255,64,128,112,72,44,26,143,200,164,114,201,108,58,159,208,168,116,74,173,90,175,216,172,118,203,237,122,191,224,176,120,76,46,155,207,232,180,122,205,110,187,223,240,184,124,78,175,219,239,248,188,126,207,239,251,255,128,129,130,131,132,67,5,16,4,87,5,6,3,81,2,137,83,143,80,139,141,145,144,78,148,150,106,7,18,11,84,153,80,146,133,73,160,154,79,165,163,88,7,22,1,1,12,134,140,138,177,161,151,71,135,173,1,21,158,66,162,75,148,168,70,14,184,17,8,68,189,77,192,78,199,69,2,184,184,186,85,14,175,156,187,71,9,19,206,184,13,0,201,67,210,70,203,169,176,149,73,194,173,196,198,181,76,221,226,90,236,68,171,217,1,232,192,183,206,232,188,234,68,215,175,66,14,248,225,226,81,168,244,107,214,17,1,208,0,40,24,56,100,89,60,121,219,222,93,211,150,238,200,42,125,11,201,45,57,176,129,220,55,106,77,14,92,40,54,46,73,184,112,198,92,229,121,184,173,164,201,132,25,27,234,83,242,14,73,179,126,71,20,224,228,243,80,30,129,255,154,200,12,10,41,149,224,129,7,108,173,102,10,81,208,82,102,190,34,28,27,41,160,199,136,157,72,146,75,155,162,204,90,196,106,199,134,9,81,126,59,50,150,9,72,127,211,58,53,17,86,139,221,33,125,91,189,41,133,19,19,128,128,166,239,174,18,97,234,116,31,82,103,12,129,146,157,171,179,29,55,161,74,198,58,216,214,44,0,67,34,68,31,96,141,203,183,162,93,117,2,112,102,62,60,192,234,7,168,106,47,39,169,236,18,92,91,68,79,141,172,218,233,239,49,19,5,9,1,124,12,173,228,26,6,124,156,145,172,106,57,49,41,77,14,88,233,188,53,132,58,183,238,207,240,66,47,43,26,28,50,226,117,192,71,179,230,201,234,28,73,193,92,1,104,32,87,207,32,243,190,182,32,224,252,71,242,88,130,12,228,96,47,40,168,17,222,200,189,90,231,58,136,109,220,52,228,226,141,93,55,132,24,42,246,236,106,72,92,211,192,33,9,177,35,0,10,146,49,51,23,0,103,213,209,160,108,45,229,245,222,16,164,45,151,160,45,207,109,68,155,17,133,253,161,255,151,16,81,113,3,65,43,250,89,212,73,2,28,120,146,95,123,145,77,182,160,93,207,84,99,222,133,12,118,194,222,75,187,212,37,90,120,184,213,7,213,87,188,132,245,98,21,215,12,212,91,90,0,170,102,65,132,16,4,150,225,84,8,204,7,96,92,10,77,183,68,145,3,92,67,204,53,244,173,51,226,43,10,204,67,18,105,217,213,132,80,142,174,89,216,92,105,78,116,136,132,155,126,25,57,193,150,19,116,137,198,135,12,126,133,29,0,204,61,244,74,61,35,222,115,20,46,67,218,84,203,119,32,86,55,80,77,230,136,105,25,135,17,180,208,86,134,66,244,22,64,83,59,122,1,91,11,227,33,137,196,45,234,100,148,76,93,103,130,119,196,118,82,20,192,129,7,15,132,176,65,10,28,132,48,33,20,219,45,6,10,153,10,69,72,169,55,195,4,167,230,167,129,150,152,4,170,210,125,186,106,171,175,198,58,235,26,61,225,35,88,152,1,152,96,1,125,123,154,74,156,60,184,12,100,30,122,20,234,114,35,23,215,16,0,37,155,86,52,134,109,54,86,14,17,255,238,184,178,121,58,5,48,2,232,231,192,99,113,33,10,5,39,24,32,48,21,6,3,168,23,69,81,43,76,51,225,131,139,13,181,235,20,246,118,117,176,17,9,115,152,46,190,250,70,192,175,191,118,84,251,233,194,246,93,73,99,106,13,105,22,81,85,24,227,105,151,149,135,180,84,170,143,251,108,220,104,161,145,152,12,205,127,91,20,160,194,18,148,97,250,132,3,39,36,34,128,9,34,180,43,133,2,36,116,224,15,94,197,137,8,9,118,34,111,86,68,195,228,46,129,171,195,72,224,172,51,207,62,223,81,173,61,206,164,203,32,114,25,215,182,113,166,32,126,21,211,183,74,176,203,241,16,187,17,71,85,123,234,94,104,174,51,54,27,77,197,201,4,46,0,179,18,111,103,35,44,202,103,23,225,0,203,204,68,4,129,183,69,63,33,0,64,181,144,138,23,198,10,245,24,142,165,232,90,252,183,211,233,222,37,34,225,128,131,193,116,20,23,129,211,35,218,92,43,200,68,195,225,64,251,24,217,1,102,128,65,83,252,44,61,129,62,5,179,179,57,77,133,63,145,255,128,11,81,187,155,106,134,221,108,69,201,8,73,94,201,109,231,34,35,83,92,195,44,57,199,54,195,170,179,62,129,214,23,47,31,61,240,197,50,223,8,241,203,174,49,251,205,36,103,120,64,232,82,144,94,40,234,70,28,242,202,225,197,28,248,181,47,148,218,107,233,222,195,113,113,247,238,203,91,92,35,11,29,4,175,4,72,254,50,5,130,244,186,9,13,83,20,48,190,133,153,207,46,232,80,223,154,104,194,56,16,73,0,127,250,91,138,149,248,7,13,255,1,176,12,219,115,66,231,152,97,39,6,85,7,91,113,99,216,215,168,52,142,188,88,0,39,50,179,156,142,214,209,190,4,45,166,23,15,26,74,160,64,72,133,249,69,161,27,246,11,83,143,86,241,57,34,140,197,114,178,81,9,218,44,208,67,111,140,231,82,152,56,216,106,12,161,2,21,238,45,122,234,154,211,2,21,226,168,148,156,75,136,63,108,137,48,160,135,193,191,200,163,136,54,241,73,26,72,168,48,0,82,143,56,77,129,19,251,164,119,36,62,253,229,137,98,136,225,41,120,55,67,121,116,255,112,127,153,195,227,23,106,114,70,25,166,145,139,202,51,140,32,7,73,200,61,16,11,11,135,44,164,34,23,201,200,70,106,238,117,89,8,151,35,39,73,201,74,90,242,146,152,204,164,38,55,201,201,78,122,242,147,160,12,165,40,71,73,202,82,154,242,148,168,76,165,42,87,201,202,86,186,242,149,176,140,165,44,103,73,203,90,218,242,150,184,204,165,46,119,153,10,251,145,49,60,121,252,101,28,132,105,45,59,16,19,108,77,56,38,50,121,105,24,95,190,200,79,77,235,88,215,246,160,204,128,124,48,27,33,188,15,182,140,180,62,154,233,195,82,152,170,102,48,243,200,204,72,8,17,106,83,72,30,185,176,102,157,98,6,5,128,39,33,167,47,48,80,141,2,208,211,9,141,10,64,45,150,227,197,42,46,51,9,223,179,2,211,242,134,196,190,121,51,39,36,106,207,50,216,217,10,205,200,179,156,81,152,92,78,0,153,19,122,45,142,69,222,49,202,95,148,210,147,108,252,164,125,19,136,155,50,205,210,51,180,149,148,9,39,107,157,65,151,70,35,107,158,43,155,255,126,75,136,148,248,180,190,68,138,206,112,24,65,71,136,220,233,55,135,66,84,12,170,154,162,26,141,119,137,248,117,135,28,246,26,41,223,252,65,2,110,61,74,11,255,35,66,84,71,183,49,68,145,176,65,1,217,80,20,40,166,52,166,217,244,169,249,244,40,50,207,147,158,112,14,169,44,74,253,169,6,181,74,33,138,130,6,64,5,67,89,139,120,90,169,55,18,36,88,26,137,138,217,254,89,5,123,214,243,158,84,13,206,135,72,88,150,101,118,20,48,23,4,209,132,68,225,85,120,102,206,33,180,41,202,160,124,179,4,180,62,84,173,175,209,218,80,69,164,18,29,142,201,102,149,57,106,219,92,148,4,73,86,138,91,201,216,224,188,200,209,24,48,98,73,75,8,224,82,146,8,184,151,162,126,137,138,184,73,233,243,232,234,163,180,238,239,61,241,235,77,108,190,186,31,127,194,168,21,102,45,2,153,74,225,144,107,54,148,183,152,173,2,113,37,56,172,1,216,106,22,184,10,45,98,24,26,129,201,234,179,180,78,229,19,106,17,19,166,196,9,145,140,170,98,255,149,171,96,37,171,230,148,32,56,239,45,66,173,6,36,148,124,238,115,65,184,90,209,113,175,136,11,232,145,85,188,149,104,44,60,136,152,62,117,28,48,72,187,208,111,174,2,217,55,57,66,55,186,225,235,38,117,173,241,128,128,49,104,96,27,138,171,51,105,151,45,130,8,197,175,120,27,18,196,246,213,47,250,36,64,104,234,66,113,219,44,92,60,147,204,165,120,190,61,200,21,187,187,190,188,197,102,25,20,51,14,100,171,33,217,141,190,213,36,237,132,48,22,158,182,151,116,1,13,197,113,149,155,12,143,214,192,7,99,40,177,211,140,90,206,236,66,181,194,42,36,113,161,10,218,208,112,26,32,72,222,116,192,47,21,168,132,93,172,220,216,128,98,57,225,37,211,142,201,44,100,45,72,244,77,149,67,220,94,44,26,205,128,30,100,72,4,133,41,103,177,169,12,193,97,174,8,241,29,66,160,27,34,103,101,204,164,188,119,126,130,157,53,20,188,205,109,110,161,16,208,138,144,32,85,140,157,54,216,185,9,229,107,155,111,200,136,62,42,151,100,199,251,154,58,255,13,182,188,69,127,217,34,39,4,199,222,16,237,55,48,170,107,120,22,72,132,200,78,188,15,21,47,185,82,95,219,211,68,148,226,82,26,154,133,173,142,238,38,74,204,149,92,14,101,250,169,201,188,236,166,209,246,192,252,193,217,68,57,106,0,109,89,88,106,240,113,47,60,86,178,50,116,41,232,9,11,14,97,170,66,0,183,3,163,61,109,82,55,65,64,33,86,13,91,21,189,238,210,142,153,22,142,24,231,178,175,224,89,43,158,171,31,101,17,134,158,25,12,21,76,83,4,160,169,102,198,170,191,219,234,41,26,145,23,90,60,39,136,135,2,216,131,251,163,160,209,52,69,114,34,24,146,118,7,232,221,92,134,55,45,96,59,111,63,216,79,25,242,128,30,67,207,57,135,145,199,72,227,96,222,38,148,15,155,53,107,244,243,30,6,143,50,74,229,221,241,154,219,252,230,56,207,185,206,119,206,243,158,251,252,231,64,15,186,208,135,78,244,162,27,253,232,72,79,186,210,151,206,244,166,59,253,233,80,143,186,212,167,78,245,170,91,253,234,88,207,186,214,3,241,44,130,174,123,253,235,96,15,187,216,199,78,246,178,155,253,236,104,79,187,218,215,206,246,182,187,253,237,112,143,187,220,231,78,247,186,219,253,238,120,207,123,215,131,0,0,59
This data is convert stream(or String) to blob image(only gif).
Attachment Image
So, I create gif to this data,
How do I convert Image to this Data?
Here is My php code When get json data
$fullcurl = "http://addr";
$result = file_get_contents($fullcurl);
$im = imagecreate(200, 200);
$bg = imagecolorallocate($im, $result);
header("Content-type: image/gif");
imagepng($im);
this code not working.
And another try to
$fullcurl = "http://addr";
$result = file_get_contents($fullcurl);
<img src="data:image/gif;base64,<?=base64_encode($result['Ask'])?>" />
Not working.
I think your data sample is not correct.
I converted following gif to base64 and it is working as below code sample.
http://netdna.webdesignerdepot.com/uploads/2008/11/sample-graphic.gif
<?php
$image = 'R0lGODlhJgKQAdUAAElNS////wCZ/xt8u2/F/5mZmWtubDJlg8/s/8bHxyCm/xKG0pDT/0VRVkCz
/+/5/4GEg6/f/6+xsN3d3VRXVjxbbCVzpQmP6AWU9DCs/1ZfYXZ5d7q8u9HS0n/M/1C5/7/l/xeB
xyB4sEBWYRCf/9/y/zdgd+jp6PT09I2Pjp/Z/w6L3aSmpSlumS5pjnDG/19jYZTW/4DM/973/wAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAAHAP8ALAAAAAAmApABAAb/wIBw
SCwaj8ikcslsOp/QqHRKrVqv2Kx2y+16v+CweEwum8/otHrNbrvf8Lh8Tq/b7/i8fs/v+/+AgYKD
hIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8
vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T1
9vf4+fr7/P3+/wADChxIsKDBgwgTKlzIsKHDhxAjSpxIsaLFixgzatzIsaPHjyBDihxJsqTJkyhT
qlzJsqXLlzBjypxJs6bNmzhz6tzJs6fP/59Agw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ICFSoK1YY
hnsQIONiIGZICA8whpHyApSyhoHwHsBCH3KYCOaRKutxh4zwHYoyHnzoCH7IJoAYiJDAHGAiHYZY
CSUgA8u3IAogA7u3iJaAAC/wiOmhAC/Qg5QoCanRfuEBG5zYiZegGZyBHqNRGqTICoghAy8gGaEh
GS8gA5axirZ4i7iYi7q4i7zYi/+++IvAGIzCOIzEWIzGeIzImIzKuIzM2IzO+IzQGI3SOI3UWI3W
eI3YmI3auI3c2I3e+I3gGI7iOI7kWI7meI7omI7quI7s2I7u+I7wGI/yOI/0WI/2eI/4mI/6uI/8
2I/++I8AGZACOZAEWZAGeZAImZAKuZAM2ZAO+ZAQGZESOZEUWZEWeZEYmZEauZEc2ZEe+ZEgGZIi
OZIkWZImeZIomZIquZIs2ZIu+ZIwGZMyOZM0WZM2eZM4mZM6uZM82ZM++ZNAGZRCOZREWZRGeZRI
mZRKuZRM2ZRO+ZRQGZVSOZVUWZVWeZVYmZVauZVc2ZVe+ZVgGZZiOZZkWZZmeZYGaJmWbBAEADs=';
echo '<img alt="sample.gif" src="data:image/gif;base64,' . $image .'" />';
Or if you are reading from file.
<?php
$data = file_get_contents('sample.gif');
echo '<img alt="sample.gif" src="data:image/gif;base64,' . base64_encode($data) .'" />';
Related
Display image from json response
Below is my json respone: {"Status":"OK","Result":"{\"Cookie\":MyCookie",\"Data\":{\"ItemPhotos\":[{ \"ITEMID\":\"MyItemsID", \"ITEMIMAGE\":\"/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCAC0AUADASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAA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lwoKHKnvU7nuOta06vK/I5q1HmXmBpU/1i/UU3OelKn+sX6iu088fb26G0tzluYU/9BFS/Zk9WoooEOFsmerUotkz1aiigY8WyerVItsnq1FFMESi2THVvzp4tU9W/OiimUP+yp6t+dO+yp6t+dFFADhap6t+dZPiKMw6cvlyOu99rYPUY6UUUPYZiWOnxuAfNmH0bFXljZJCizyYBx2/woooewdTThg+XmVz9cf4U82cEhxJGkn+8in+lFFWiHuMl0jTyhzZwf8Aftf8Kpf2DpczYazQf7pIoooFdjx4T0gjP2c/99mkbw3pcIylv+ZoooC7KRtYoGIjXaKvWyZA+ZqKKYGnBCCBy1XUt1/vN+dFFIaHiIKeGb8ak8pCORRRTRSIjCIpV2M2HOCvasjVtFswvmqrKSegPFFFY1kuQ1ot8xzd/wCF9OudLnuJxK5XgIWG38sc1b8PaXbWWg2kcClFKbyBgcnrRRSglyoVVtyZzvjXw5p8VgdRijaOcvhghAVvcjHX6V5nMgBPJ4ooqJfEdVB3hqRxsyNwxq2kj7fvUUVnI6okF3fTwRlkfmut8M6LbXNvFeTvLLMwzliCB9BjiiisqmkTeO531haRoi4LfnWkbZNvVulFFYR2Oee41LdORlqelsnmry3UUUV6FL4EeVX/AIjP/9k=\", \"IMAGEID\":\"ImageID", \"IMAGEDESCR\":\"xxx.jpg\", \"IMAGETYPE\":\"TheImageType\", \"IMAGESIZE\":\"320 x 240\"},]}, \"Messages\":[]}","Error":null,"ErrorCode":null,"Benchmark":0} I want to diplay the image of json response and i use the code below unsuccessfully $image=json_decode($decoded['Result']); $path=$image->Data->ItemPhotos[0]->{'ITEMIMAGE'}; $icon=glob($path."*.jpeg"); foreach($icon as $img) { echo '<img src="'.$img.'" /><br />'; }
You have two quick solutions for this. One is to persist the encoded image and append the path to the image src. Another solution is to process the json and use the base 64 processor in correct format eg:- 'data:image/png;base64,' + <base 64 encoded image> or, 'data:image/jpg;base64,' + <base 64 encoded image> I created a snippet that works with your use case. You have to refactor it a bit to accommodate your changes. <?php // Lets assugme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VBdwCVPNj5OOR61NkjofwNJu2HcBwfvD+opSSkrMpOzuYkkuw88VWa7HTvWpqdr+5a4hG5P41H865K4ldG+UcH1rgqJxdmddO0ldHKfFJ2fQFuY1/eWsqyg+nY/oa5zTr7zbaNw2UZQRXSeLyLvRJrdnzvHOK47wto9/caTdS28LS29qwBYdeeoHrjv6ZpwV4Gt+Xc6CO728itC11AED5sVzJlK0iXhQ9aHEZ30GoDIIPataC/46157bamMda0oNVA/i4+tYyTRooJnoEV4DjmrccwboeK4qDWFAHz4rRj122UcygfjUczQOl2Onk2upx1qDJ6HqKrWt+lwoKHKnvU7nuOta06vK/I5q1HmXmBpU/1i/UU3OelKn+sX6iu088fb26G0tzluYU/9BFS/Zk9WoooEOFsmerUotkz1aiigY8WyerVItsnq1FFMESi2THVvzp4tU9W/OiimUP+yp6t+dO+yp6t+dFFADhap6t+dZPiKMw6cvlyOu99rYPUY6UUUPYZiWOnxuAfNmH0bFXljZJCizyYBx2/woooewdTThg+XmVz9cf4U82cEhxJGkn+8in+lFFWiHuMl0jTyhzZwf8Aftf8Kpf2DpczYazQf7pIoooFdjx4T0gjP2c/99mkbw3pcIylv+ZoooC7KRtYoGIjXaKvWyZA+ZqKKYGnBCCBy1XUt1/vN+dFFIaHiIKeGb8ak8pCORRRTRSIjCIpV2M2HOCvasjVtFswvmqrKSegPFFFY1kuQ1ot8xzd/wCF9OudLnuJxK5XgIWG38sc1b8PaXbWWg2kcClFKbyBgcnrRRSglyoVVtyZzvjXw5p8VgdRijaOcvhghAVvcjHX6V5nMgBPJ4ooqJfEdVB3hqRxsyNwxq2kj7fvUUVnI6okF3fTwRlkfmut8M6LbXNvFeTvLLMwzliCB9BjiiisqmkTeO531haRoi4LfnWkbZNvVulFFYR2Oee41LdORlqelsnmry3UUUV6FL4EeVX/AIjP/9k=", "IMAGEID": "ImageID", "IMAGEDESCR": "xxx.jpg", "IMAGETYPE": "TheImageType", "IMAGESIZE": "320 x 240" }'; $decode = json_decode($json); // you need base 64 processor $processor = ""; if($decode->IMAGEDESCR == "xxx.jpg") { $processor = "data:image/jpg;base64,"; } elseif ($decode->IMAGEDESCR == "xxx.png") { $processor = "data:image/png;base64,"; } $img_src = $processor . $decode->ITEMIMAGE; echo '<img src='.$img_src.'/>'; ?>
Your src attribute for the img tag will be something like this 'data:image/png;base64,' + $path; you must inform that the image is encoded base64 (I suppose it is) and also specify the kind of data (image/png) in my example
Retrieve image long raw datatype stored in oracle database in php
I tried to display image stored in oracle database I get it as decode data I tried to this code but not work first way $img= studimage::select('studimage')->where('studnum',$id)->first(); header("Content-type: image/jpeg"); echo ($img->studimage) ; sec-way echo '<img src="data:image/jpg;base64,'. base64_encode($img->studimage). '" />'; the two ways does not work :(
I'm using this same functionality in one of my project, please check my code below you can either make a page that will render the image <img src="image.php?id=123" /> That image.php page would have this: $sql = "SELECT image FROM images WHERE image_id = " . (int) $_GET['id']; $stid = oci_parse($conn, $sql); oci_execute($stid); $row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS); if (!$row) { header('Status: 404 Not Found'); } else { $img = $row['IMAGE']->load(); header("Content-type: image/jpeg"); print $img; } Or, you could base64 encode it into the src (note, not all browsers handle this well): <img src="data:image/jpeg;base64,<?php echo base64_encode($img); ?>" />
Convert API URL to “data:image/png;base64" by PHP
The following API URL has an output in PNG image: http://qrfree.kaywa.com/?l=1&s=8&d=google.com I want convert the API URL to “data:image/png;base64” (DATA URL / DATA URI) with the similar to the PHP code example below: $image = ("<img src = http://qrfree.kaywa.com/?l=1&s=8&d=google.com"); // False! (only example!) //or $image = 'real-picture.png'; // True! $imageData = base64_encode(file_get_contents($image)); $src = 'data:image/png;base64,'.$imageData; echo '<img src="'.$src.'">'; However, the above code works with a real picture which has specified format and if replaced with the API URL, cannot read image path. How the code should be corrected?
Assuming a web request to http://qrfree.kaywa.com/?l=1&s=8&d=google.com returns an image of type image/png, you can do ... $image = "http://qrfree.kaywa.com/?l=1&s=8&d=google.com"; echo '<img src="data:image/png;base64,', base64_encode(file_get_contents($image)), '">'; file_get_contents() expects either a valid file name or a valid http(s) request. Your code was passing in something starting with some HTML <img ...
Php display image from url into homepage
after no one answered at this question Php Rss feed use img in CDATA -> content:encoded i try to do something else solving this problem... how can i load an image from a given url directly into my homepage? <?php $url = "..."; $image = file_get_contents("$url"); echo $image; ?> *i don't want to save the image anywhere... just load the image from the url and show it in my own homepage.
Try this code,work fine on my machine. <?php $image = 'http://www.google.com/doodle4google/images/d4g_logo_global.jpg'; $imageData = base64_encode(file_get_contents($image)); echo '<img src="data:image/jpeg;base64,'.$imageData.'">'; ?>
You are almost there. When you download the contents of the file you need to encode it to base64 if you do not plan to store it on server. <?php $url = '...'; $image = base64_encode(file_get_contents($url)); ?> Then you can display it: <img src="data:image/x-icon;base64,<?= $image ?>">
How to decode a base64 string (gif) into image in PHP / HTML
I have a base64 encoded string that I would like to convert into an image in PHP / HTML. Here is what I have: $data = "R0lGODdhAAGAAKIAAP38+/3h3cjN5P3HwgAAAP8AoP8AGv8EIywAAAAAAAGAAAAD....."; echo base64_decode($data); // OR echo '<img src="data:image/gif;base64,' . base64_decode($data) . '" />'; None of those work. Any suggestions? Much appreciated! Catalin
In the first case you should add this before echoing the decoded image data: header("Content-type: image/gif"); In the second case, use this instead: echo '<img src="data:image/gif;base64,' . $data . '" />';
Display Image using base64_encode function $ret = fopen($fullurl, 'r', true, $context); $contents = stream_get_contents($ret); $base64 = 'data:image/PNG;base64,' . base64_encode($contents); echo "<img src=$base64 />" ;
echo '<img src="data:image/gif;base64,' . $data . '" />' Should do the trick.
Stupid question: is the mime-type correct?? is your base64 code represent a gif file???? this is an example using a image/png, without php, just html, and it works: <img alt="Embedded Image" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAIAAAABlV4SAAAABGdBTUEAAK/INwWK6QAAABl0RVh0 U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAABJFSURBVHja1FoLmFTFla5zqu7tGRgRGB4J gkAAgSU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iSZf0nj0l4UONNy3fRrBW/fC2TGWFiSMkK6LZKOtTSU0zbGLCWN2yCDmMNjMOl5pW7dxEQFy3 H0YDpTpzdAk6NEWT6YYOkd6HSNql0TBuSFIHuYTfAI9pwpqrKilJ/+iugLNHXr35mhESgC3tC2ez of7qJwyrOCIXeNoN6wNoP3dWeqSu7ONwCO1igPaTPn37YFMt/zaTS1mBN9lECRTmGc+1cES5YVEw 8riKu+4QSec9dcCm71qZK5l2ZmboCLNzY+hPodCjR5eAKhF/R7B9RE6R4eqVBJMM85Mt4IuvyDfU stzgooAzeHBm1KgwITuauMGTnGwQxJV9B9/cyrKPZQP/vhCNbwB20UmH9FDL7TfJabyYD1z4soaD UhO7wXfnM9YgH/A4JeE5myguiwW28Bi+z0/1OdMypcfQuurcXtosHT0SCE57yM1ld7Py6PWUSUk8 6NMPqJz41WId12uXkyMbWd/85CbZmj8iFdPtTtx1R0A7Wimtde6lZOg6OfaWYwfY8Fdz+lR+FIbh F79YcdcPKvNNGOVYY9aX0zHO+UrxGJc3I9115z89bWpKW+hyeuw7C7Xvn9k0+JCd/HkVbn2FcZ4/ eOgfff9Wk3JCmPiAcEvQdbqA4gngogxN0cJuuD7T1shHVqVU8oeawAef7Zux5sqg/YulEVxiIJTr 0R/6WwSGLcQ+kxebTJAWSILNcOIkO2USDh0MQ45R3arUi6vh5w/F7+5BYSnTI+sppkwnkY/QFUfT i+ouNsx1IsK0b1QC9n0NgKVG4k8RwKFt/COYB/5/vP5PgAEA77fJf3rfdyAAAAAASUVORK5CYII=" /> Just try it. Now, the same base64 code using the php exemplified above but using the proper mime-type (image/png): <?php echo "<img alt=Embedded Image src=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEEAAABBCAIAAAABlV4SAAAABGdBTUEAAK/INwWK6QAAABl0RVh0 U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAABJFSURBVHja1FoLmFTFla5zqu7tGRgRGB4J gkAAgSUBgyiQiIpm1UCMH6h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RrBW/fC2TGWFiSMkK6LZKOtTSU0zbGLCWN2yCDmMNjMOl5pW7dxEQFy3 H0YDpTpzdAk6NEWT6YYOkd6HSNql0TBuSFIHuYTfAI9pwpqrKilJ/+iugLNHXr35mhESgC3tC2ez of7qJwyrOCIXeNoN6wNoP3dWeqSu7ONwCO1igPaTPn37YFMt/zaTS1mBN9lECRTmGc+1cES5YVEw 8riKu+4QSec9dcCm71qZK5l2ZmboCLNzY+hPodCjR5eAKhF/R7B9RE6R4eqVBJMM85Mt4IuvyDfU stzgooAzeHBm1KgwITuauMGTnGwQxJV9B9/cyrKPZQP/vhCNbwB20UmH9FDL7TfJabyYD1z4soaD UhO7wXfnM9YgH/A4JeE5myguiwW28Bi+z0/1OdMypcfQuurcXtosHT0SCE57yM1ld7Py6PWUSUk8 6NMPqJz41WId12uXkyMbWd/85CbZmj8iFdPtTtx1R0A7Wimtde6lZOg6OfaWYwfY8Fdz+lR+FIbh F79YcdcPKvNNGOVYY9aX0zHO+UrxGJc3I9115z89bWpKW+hyeuw7C7Xvn9k0+JCd/HkVbn2FcZ4/ eOgfff9Wk3JCmPiAcEvQdbqA4gngogxN0cJuuD7T1shHVqVU8oeawAef7Zux5sqg/YulEVxiIJTr 0R/6WwSGLcQ+kxebTJAWSILNcOIkO2USDh0MQ45R3arUi6vh5w/F7+5BYSnTI+sppkwnkY/QFUfT i+ouNsx1IsK0b1QC9n0NgKVG4k8RwKFt/COYB/5/vP5PgAEA77fJf3rfdyAAAAAASUVORK5CYII=\" />"; ?> So, this is the code: echo "<img alt=Embedded Image src=\"data:image/png;base64,[BASE64CODE]\" />"; Notice, since I am using double quotes for the echo tag, I have to tell php to ignore the ones inside the img tag. Other than that, you are good cheers PC
You have to use the header() function before echoing your data to specify the content type (gif image). Otherwise browsers will interpret it as html.