Created
May 16, 2011 04:55
-
-
Save sgricci/973952 to your computer and use it in GitHub Desktop.
Check Image Support in PHP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function check_image_support() | |
{ | |
echo 'Checking Image Support: '."\n"; | |
//IMG_GIF | IMG_JPG | IMG_PNG | IMG_WBMP | IMG_XPM | |
if (imagetypes() & IMG_GIF) | |
echo "GIF: \tYes"; | |
else | |
echo "GIF: \tNo"; | |
echo "\n"; | |
if (imagetypes() & IMG_JPG) | |
echo "JPG: \tYes"; | |
else | |
echo "JPG: \tNo"; | |
echo "\n"; | |
if (imagetypes() & IMG_PNG) | |
echo "PNG: \tYes"; | |
else | |
echo "PNG: \tNo"; | |
echo "\n"; | |
if (imagetypes() & IMG_WBMP) | |
echo "WBMP: \tYes"; | |
else | |
echo "WBMP: \tNo"; | |
echo "\n"; | |
if (imagetypes() & IMG_XPM) | |
echo "XPM: \tYes"; | |
else | |
echo "XPM: \tNo"; | |
echo "\n"; | |
echo "Support Check Complete\n"; | |
return; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment