News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Suggestion: adding „width” and „height” attibutes to images

Started by man.of.earth, October 24, 2019, 14:18:10 PM

Previous topic - Next topic

man.of.earth

Hello,

Some sources recommend that images have the ,,width" and ,,height" attributes set, for speed, easiness in rendering the pages and SEO reasons.
I was wondering: could this be added to the core?

Some time ago I did some custom modifications in the administrator/components/com_virtuemart/helpers/mediahandler.php (around line 654):
if($lightbox){
$full_url=$root . $file_url;
if((substr($full_url, 0, 4)!="http") and (substr($full_url, 0, 1)!="/")) $full_url='/' . $full_url;
$size = getimagesize($_SERVER['DOCUMENT_ROOT'] . '/' . $file_url);
$image = '<img src="' . $full_url . '" alt="' . $file_alt . '" title="' . $file_alt . '" ' . $args . ' width="' . $size[0] . '" height="' . $size[1] . '"/>'; #//JHtml::image($file_url, $file_alt, $imageArgs);

but maybe there is a simpler way to achieve this.
Thanks developers team for your attention.