note 85909 added to function.imagecreatefromstring
| From: | ville dot jungman at gmail dot com | Date: | Wed, 24 Sep 2008 09:01:36 +0000 |
| Subject: | note 85909 added to function.imagecreatefromstring | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-144662@lists.php.net to get a copy of this message | ||
While downloading images from internet, it's easiest to let php decide what is the file type.
So, forget using imagecreatefromjpg, imagecreatefromgif and imagecreatefrompng. Instead, this is the
way to go:
<?php
$src = "http://www.varuste.net/tiedostot/l_ylabanneri.jpg";
$image = imagecreatefromstring(file_get_contents($src));
?>
----
Server IP: 62.237.7.3
Probable Submitter: 84.239.217.145
----
Manual Page -- http://www.php.net/manual/en/function.imagecreatefromstring.php
Edit -- https://master.php.net/note/edit/85909
Del: integrated -- https://master.php.net/note/delete/85909/integrated
Del: useless -- https://master.php.net/note/delete/85909/useless
Del: bad code -- https://master.php.net/note/delete/85909/bad+code
Del: spam -- https://master.php.net/note/delete/85909/spam
Del: non-english -- https://master.php.net/note/delete/85909/non-english
Del: in docs -- https://master.php.net/note/delete/85909/in+docs
Del: other reasons-- https://master.php.net/note/delete/85909
Reject -- https://master.php.net/note/reject/85909
Search -- https://master.php.net/manage/user-notes.php