I wrote this function that returns an array with the supported image types
<?php
function getSupportedImageTypes() {
$aSupportedTypes = array();
$aPossibleImageTypeBits = array(
"IMG_GIF",
"IMG_JPG",
"IMG_PNG",
"IMG_WBMP"
);
foreach ($aPossibleImageTypeBits as $iIndex => $sImageTypeBits) {
$sEval = "if (";
$sEval .= "imagetypes() & " . $sImageTypeBits . "";
$sEval .= ") { return TRUE; } else { return FALSE; }";
if (eval($sEval)) {
$aSupportedTypes[] = str_replace("IMG_", "", $sImageTypeBits);
}
}
return $aSupportedTypes;
}
?>
Hope that helps someone :)
/Jocke Selin
PS, if you know of a better way that doesn't include eval(), please let me know.