note 64316 deleted from function.imagecreatefromjpeg by bjori
| From: | bjori@php.net | Date: | Wed, 12 Apr 2006 10:14:39 +0000 |
| Subject: | note 64316 deleted from function.imagecreatefromjpeg by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107849@lists.php.net to get a copy of this message | ||
Note Submitter: mancini at nextcode dot org Vlad Alexa Mancini
Reason: useless
----
you can use this function imagecreatefromany() if you do not know the filetype
<?php
function imagecreatefromany($file){
$info = getimagesize($file);
switch($info[mime]){
case 'image/gif' : return imagecreatefromgif($file);
case 'image/jpeg' : return imagecreatefromjpeg($file);
case 'image/png' : return imagecreatefrompng($file);
default : die("Failed to render image.");
}
}
?>