mirror of
https://github.com/e107inc/e107.git
synced 2025-08-30 09:39:55 +02:00
Issue #4270 Added .webp browser-support detection. Media-Manager "Convert to webp during render" can now be safely enabled and will temporarily fallback to the regular image if the browser does not support webp images.
This commit is contained in:
@@ -1192,6 +1192,11 @@ while($row = $sql->fetch())
|
||||
'options' => array('w'=>300, 'h'=>200, 'scale'=>'2x'),
|
||||
'expected' =>'/thumb.php?src=e_PLUGIN%2Fgallery%2Fimages%2Fbutterfly.jpg&w=600&h=400'
|
||||
),
|
||||
4 => array(
|
||||
'path' => '{e_PLUGIN}gallery/images/horse.jpg',
|
||||
'options' => array('w'=>300, 'h'=>200, 'scale'=>'2x', 'type'=>'webp'),
|
||||
'expected' =>'/thumb.php?src=e_PLUGIN%2Fgallery%2Fimages%2Fhorse.jpg&w=600&h=400&type=webp'
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
@@ -2298,14 +2303,15 @@ while($row = $sql->fetch())
|
||||
|
||||
$this->tp->setConvertToWebP(true);
|
||||
$result6 = $this->tp->toImage($src);
|
||||
$expected = '<img class="img-responsive img-fluid" src="thumb.php?src=e_PLUGIN%2Fgallery%2Fimages%2Fbutterfly.jpg&w=80&h=80&type=webp" alt="butterfly.jpg" srcset="thumb.php?src=e_PLUGIN%2Fgallery%2Fimages%2Fbutterfly.jpg&w=320&h=320&type=webp 4x" width="80" height="80" />';
|
||||
|
||||
|
||||
/*
|
||||
$expected = '<picture class="img-responsive img-fluid">
|
||||
<source type="image/webp" srcset="thumb.php?src=e_PLUGIN%2Fgallery%2Fimages%2Fbutterfly.jpg&w=320&h=320&type=webp 4x">
|
||||
<source type="image/jpeg" srcset="thumb.php?src=e_PLUGIN%2Fgallery%2Fimages%2Fbutterfly.jpg&w=320&h=320 4x">
|
||||
<source type="image/webp" srcset="thumb.php?src=e_PLUGIN%2Fgallery%2Fimages%2Fbutterfly.jpg&w=80&h=80&type=webp">
|
||||
<img class="img-responsive img-fluid" src="thumb.php?src=e_PLUGIN%2Fgallery%2Fimages%2Fbutterfly.jpg&w=80&h=80" alt="butterfly.jpg" width="80" height="80" />
|
||||
</picture>';
|
||||
</picture>';*/
|
||||
|
||||
// $tempDir = str_replace(['C:','\\'],['','/'], sys_get_temp_dir()).'/'; // FIXME
|
||||
$result6 = preg_replace('/"([^"]*)thumb.php/','"thumb.php', $result6);
|
||||
|
Reference in New Issue
Block a user