mirror of
https://github.com/e107inc/e107.git
synced 2025-08-13 10:04:35 +02:00
Issue #4270 - perform all webp conversion checks within e_thumbnail class. WebP conversion now works with SEF media URLS.
This commit is contained in:
@@ -2301,25 +2301,7 @@ while($row = $sql->fetch())
|
||||
$result5 = $this->tp->toImage($src, ['type'=>'webp']);
|
||||
$this->assertStringContainsString('&type=webp', $result5); // src
|
||||
|
||||
$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>';*/
|
||||
|
||||
// $tempDir = str_replace(['C:','\\'],['','/'], sys_get_temp_dir()).'/'; // FIXME
|
||||
$result6 = preg_replace('/"([^"]*)thumb.php/','"thumb.php', $result6);
|
||||
|
||||
// $result6 = str_replace($tempDir, '', $result6);
|
||||
$expected = str_replace("\r", '', $expected);
|
||||
$this->assertSame($expected,$result6);
|
||||
$this->tp->setConvertToWebP(false);
|
||||
|
||||
|
||||
$tests = array(
|
||||
|
Reference in New Issue
Block a user