mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge branch '3.3.x'
This commit is contained in:
commit
3629b587fa
1 changed files with 18 additions and 5 deletions
|
@ -542,12 +542,17 @@ function get_supported_image_types($type = false)
|
||||||
case IMAGETYPE_WBMP:
|
case IMAGETYPE_WBMP:
|
||||||
$new_type = ($format & IMG_WBMP) ? IMG_WBMP : false;
|
$new_type = ($format & IMG_WBMP) ? IMG_WBMP : false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// WEBP
|
||||||
|
case IMAGETYPE_WEBP:
|
||||||
|
$new_type = ($format & IMG_WEBP) ? IMG_WEBP : false;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$new_type = array();
|
$new_type = [];
|
||||||
$go_through_types = array(IMG_GIF, IMG_JPG, IMG_PNG, IMG_WBMP);
|
$go_through_types = [IMG_GIF, IMG_JPG, IMG_PNG, IMG_WBMP, IMG_WEBP];
|
||||||
|
|
||||||
foreach ($go_through_types as $check_type)
|
foreach ($go_through_types as $check_type)
|
||||||
{
|
{
|
||||||
|
@ -558,14 +563,14 @@ function get_supported_image_types($type = false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return [
|
||||||
'gd' => ($new_type) ? true : false,
|
'gd' => ($new_type) ? true : false,
|
||||||
'format' => $new_type,
|
'format' => $new_type,
|
||||||
'version' => (function_exists('imagecreatetruecolor')) ? 2 : 1
|
'version' => (function_exists('imagecreatetruecolor')) ? 2 : 1
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return array('gd' => false);
|
return ['gd' => false];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -659,6 +664,10 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||||
case IMG_WBMP:
|
case IMG_WBMP:
|
||||||
$image = @imagecreatefromwbmp($source);
|
$image = @imagecreatefromwbmp($source);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IMG_WEBP:
|
||||||
|
$image = @imagecreatefromwebp($source);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (empty($image))
|
if (empty($image))
|
||||||
|
@ -710,6 +719,10 @@ function create_thumbnail($source, $destination, $mimetype)
|
||||||
case IMG_WBMP:
|
case IMG_WBMP:
|
||||||
imagewbmp($new_image, $destination);
|
imagewbmp($new_image, $destination);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case IMG_WEBP:
|
||||||
|
imagewebp($new_image, $destination);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
imagedestroy($new_image);
|
imagedestroy($new_image);
|
||||||
|
|
Loading…
Add table
Reference in a new issue