mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 11:50:30 +02:00
Only test WebP format on the appropriate PHP versions.
This commit is contained in:
@@ -149,23 +149,29 @@
|
|||||||
// 'c' => 'r', // crop right
|
// 'c' => 'r', // crop right
|
||||||
),
|
),
|
||||||
|
|
||||||
// Test WebP format resize.
|
|
||||||
16 => array (
|
|
||||||
|
);
|
||||||
|
|
||||||
|
// WebP support added in PHP 7.1+
|
||||||
|
if (version_compare(phpversion(), '7.0', '>'))
|
||||||
|
{
|
||||||
|
// Test WebP format resize.
|
||||||
|
$tests[] = array(
|
||||||
'src' => 'e_PLUGIN/gallery/images/beach.webp',
|
'src' => 'e_PLUGIN/gallery/images/beach.webp',
|
||||||
'aw' => 455,
|
'aw' => 455,
|
||||||
'ah' => 0,
|
'ah' => 0,
|
||||||
|
|
||||||
),
|
);
|
||||||
|
|
||||||
// Test Converting JPEG to WebP and resize. (Stored index file is saved with a .jpg extension but encoded as WebP)
|
// Test Converting JPEG to WebP and resize. (Stored index file is saved with a .jpg extension but encoded as WebP)
|
||||||
17 => array (
|
$tests[] = array(
|
||||||
'src' => 'e_PLUGIN/gallery/images/butterfly.jpg',
|
'src' => 'e_PLUGIN/gallery/images/butterfly.jpg',
|
||||||
'w' => 222,
|
'w' => 222,
|
||||||
'h' => 272,
|
'h' => 272,
|
||||||
'type'=>'webp'
|
'type'=>'webp'
|
||||||
),
|
);
|
||||||
|
}
|
||||||
);
|
|
||||||
|
|
||||||
foreach($tests as $index => $val)
|
foreach($tests as $index => $val)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user