note 22284 deleted from function.imagecreatefromstring by sniper
| From: | sniper@php.net | Date: | Fri, 30 May 2003 15:08:22 +0000 |
| Subject: | note 22284 deleted from function.imagecreatefromstring by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-49429@lists.php.net to get a copy of this message | ||
Note Submitter: lunatic@NOSPAMskonux.net
----
Since apache locks up when reading some gif images with imagecreatefromstring,
you could save it to a file, and then use:
$bilde = "temporary.file";
$size = @getimagesize($bilde);
switch ($size[2]) {
case 1:
$im = imagecreatefromgif($bilde);
break;
case 2:
$im = imagecreatefromjpeg($bilde);
break;
case 3:
$im = imagecreatefrompng($bilde);
break;
default:
echo "Invalid imageformat! <!-- ".$size[2]." -->";
break;
}