note 104147 modified in function.imagecreatefromjpeg by danbrown
| From: | danbrown@php.net | Date: | Thu, 26 May 2011 17:52:08 +0000 |
| Subject: | note 104147 modified in function.imagecreatefromjpeg by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-180060@lists.php.net to get a copy of this message | ||
Create an image resource from file, without knowing image type:
<?php
function imagecreatefromfile($imagepath=false) {
if(!$imagepath || !$is_readable($imagepath) return false;
return @imagecreatefromstring(file_get_contents($imagepath));
}
$img_resource=imagecreatefromfile($imagepath);
?>
--was--
Create an image resource from file, without knowing image type:
<?php
function imagecreatefromfile($imagepath=false) {
if(!$imagepath || !$is_readable($imagepath) return false;
return @imagecreatefromstring(file_get_contents($imagepath));
}
$img_resource=imagecreatefromfile($imagepath);
?>
http://php.net/manual/en/function.imagecreatefromjpeg.php