1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
|
<?php
/////////////////////////////////////////////////////////////////////////////
//
// image.toolbox.inc.php
function GetSupportedImageTypes() {
$arrTypes = array();
$arrTypeBits = array( IMG_GIF => "GIF", IMG_JPG => "JPG", IMG_PNG => "PNG", IMG_WBMP => "WBMP" );
foreach ( $arrTypeBits as $intTypeBits => $strType ) {
if ( imageTypes() & $intTypeBits ) {
$arrTypes[] = $strType;
}
}
return $arrTypes;
}
function gdVersion() {
if ( ! extension_loaded( "gd" ) ) {
return;
}
ob_start();
phpinfo( 8 );
$info = ob_get_contents();
ob_end_clean();
$info = stristr( $info, "gd version" );
preg_match( "/\d/", $info, $gd );
return $gd[ 0 ];
}
?>
|