There should be 'height' and 'width' attributes as well as loading="lazy"
There are no 'height' and 'width' attributes or loading="lazy"
J4.0.6
In the /plugins/fields/media/tmpl/media.php file lines 33 to 50 are:
if ($img->attributes['width'] > 0 && $img->attributes['height'] > 0)
{
$buffer = sprintf('<img loading="lazy" width="%s" height="%s" src="%s"%s%s>',
$img->attributes['width'],
$img->attributes['height'],
$imgUrl,
$class,
$alt
);
}
else
{
$buffer = sprintf('<img src="%s"%s%s>',
$imgUrl,
$class,
$alt
);
}
with line 35 looking for width and height. But it's obviously not picking those attributes up. Why? If an image is added to an article in the editor, all three attributes are added, so the data is obviously available.
Labels |
Added:
No Code Attached Yet
|
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-02-11 19:04:53 |
Closed_By | ⇒ | Quy |
Please test #37008