From 85c283be53cdfc4ff4b39730f40cac697b707f5d Mon Sep 17 00:00:00 2001 From: Martin Kraemer Date: Thu, 19 Oct 2000 12:45:25 +0000 Subject: [PATCH] Add Rasmus' hint to use ImageType() git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@34121 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/image.xml | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) diff --git a/functions/image.xml b/functions/image.xml index b25be6f548..fa67136265 100644 --- a/functions/image.xml +++ b/functions/image.xml @@ -1067,15 +1067,15 @@ function LoadPNG ($imgname) { <?php - if(function_exists("imagegif")) { + if (function_exists("imagegif")) { Header("Content-type: image/gif"); ImageGif($im); } - elseif(function_exists("imageJpeg")) { + elseif (function_exists("imagejpeg")) { Header("Content-type: image/jpeg"); ImageJpeg($im, "", 0.5); } - elseif(function_exists("imagePng")) { + elseif (function_exists("imagepng")) { Header("Content-type: image/png"); ImagePng($im); } @@ -1086,6 +1086,27 @@ function LoadPNG ($imgname) { + + + In PHP4 as of version 4.0.2 you can use the function + imagetypes in place of + function_exists for checking + the presence of the various supported image formats: + + +if (ImageTypes() & IMG_GIF) { + Header("Content-type: image/gif"); + ImageGif($im); +} +elseif (ImageTypes() & IMG_JPG) { +... etc. + + + + + + See also ImagePng, + ImageJpeg, ImageTypes. @@ -1122,6 +1143,10 @@ ImagePng($im); + + See also ImageGif, + ImageJpeg, ImageTypes. + @@ -1164,6 +1189,10 @@ ImagePng($im); + + See also ImagePng, + ImageGif, ImageTypes. +