1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-13 10:04:35 +02:00

Issue #4270 - WebP on-the-fly conversion. Fix blurry image and include class for styling.

This commit is contained in:
Cameron
2020-12-10 18:57:00 -08:00
parent 4a30f88f2c
commit 0de1ad8df4
2 changed files with 7 additions and 5 deletions

View File

@@ -4774,9 +4774,8 @@ class e_parser
{
$parm['type'] = 'webp';
$source = $tp->thumbUrl($file,$parm);
$html = "<picture>\n";
$html .= '<source type="image/webp" srcset="'.$source.'">';
$html .= "\n";
$html = "<picture class=\"{$class}\">\n";
if(!empty($parm['srcset']))
{
list($webPSourceSet,$webPSize) = explode(' ', $parm['srcset']);
@@ -4786,6 +4785,9 @@ class e_parser
$html .= "\n";
$srcset = ''; // remove it from the img tag below.
}
$html .= '<source type="image/webp" srcset="'.$source.'">';
$html .= "\n";
}
$html .= "<img {$id}class=\"{$class}\" src=\"".$path."\" alt=\"".$alt."\" ".$srcset.$width.$height.$style.$loading.$title." />";