note 124517 added to function.imagecreatefromstring
| From: | adeline dot duterre at boxify dot be | Date: | Tue, 17 Dec 2019 16:28:56 +0000 |
| Subject: | note 124517 added to function.imagecreatefromstring | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-213549@lists.php.net to get a copy of this message | ||
Many websites add, during the conversion from .jpg / .png to base64 some words before the base64
string : "data:image/png;base64,"
If you let them, the PHP function will return an error "Data is not in a recognized format
in".
If you have this situation :
$image_string=str_replace("data:image/png;base64,","",$image_string);
$image_string = base64_decode($image_string);
$img = imagecreatefromstring($image_string);
----
Server IP: 208.43.231.9
Probable Submitter: 185.85.3.195 (proxied: 185.174.184.110)
----
Manual Page -- http://php.net/manual/en/function.imagecreatefromstring.php
Edit -- https://master.php.net/note/edit/124517
Del: integrated -- https://master.php.net/note/delete/124517/integrated
Del: useless -- https://master.php.net/note/delete/124517/useless
Del: bad code -- https://master.php.net/note/delete/124517/bad+code
Del: spam -- https://master.php.net/note/delete/124517/spam
Del: non-english -- https://master.php.net/note/delete/124517/non-english
Del: in docs -- https://master.php.net/note/delete/124517/in+docs
Del: other reasons-- https://master.php.net/note/delete/124517
Reject -- https://master.php.net/note/reject/124517
Search -- https://master.php.net/manage/user-notes.php