mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-05 16:27:38 +02:00
- added ability to grab supported gd formats
git-svn-id: file:///svn/phpbb/trunk@5039 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -376,13 +376,15 @@ function get_img_size_format($width, $height)
|
||||
}
|
||||
|
||||
// Return supported image types
|
||||
function get_supported_image_types($type)
|
||||
function get_supported_image_types($type = false)
|
||||
{
|
||||
if (@extension_loaded('gd'))
|
||||
{
|
||||
$format = imagetypes();
|
||||
$new_type = 0;
|
||||
|
||||
if ($type !== false)
|
||||
{
|
||||
switch ($type)
|
||||
{
|
||||
case 1:
|
||||
@@ -403,6 +405,20 @@ function get_supported_image_types($type)
|
||||
$new_type = ($format & IMG_WBMP) ? IMG_WBMP : 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$new_type = array();
|
||||
$go_through_types = array(IMG_GIF, IMG_JPG, IMG_PNG, IMG_WBMP);
|
||||
|
||||
foreach ($go_through_types as $check_type)
|
||||
{
|
||||
if ($format & $check_type)
|
||||
{
|
||||
$new_type[] = $check_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array(
|
||||
'gd' => ($new_type) ? true : false,
|
||||
|
Reference in New Issue
Block a user