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. +