?
avatar 810
810
14 Apr 2016

Steps to reproduce the issue

Go to frontend, with breadcrumbs enabled, do an audit test with chrome. Then you see that the divider is missing a width and height tag.

Expected result

No issue

Actual result

Specify image dimensions (1)
A width and height should be specified for all images in order to speed up page display. The following image(s) are missing a width and/or height:
arrow.png
(2 uses)

System information (as much as possible)

Additional comments

We need to parse the height and width on the JHtml:_('image') side.

for example this code we use to show the width and height:

$location = JUri::root() . $attachment->getUrl();
$data = getimagesize($location);
$width = $data[0];
$height = $data[1];


<img src="<?php echo $attachment->getUrl(); ?>" width="<?php echo $width ;?>" height="<?php echo $height ;?>" alt="" />

This is needed for a w3c validation checks, or any other html checks like in the inspector from chrome (audit - ).

Now if you check a clean protostar template. he is showing a dimension notice to fix the height and width tag.

tests

avatar 810 810 - open - 14 Apr 2016
avatar brianteeman
brianteeman - comment - 14 Apr 2016

I dont get that report in my chrome audit but thats not relevant

Your title says that its an issue with JHtml:_('image')
Why do you say that?

If you want to add dimensions using JHtml:_('image') you can do it as stated in the docblock and seen elsewhere in the core

JHtml::_('image', 'media/dots.gif', '...', array('width' => 22, 'height' => 12), true)

All that is needed for mod_breadcrumbs is to add that array


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9919.

avatar brianteeman brianteeman - change - 14 Apr 2016
Category Front End
avatar brianteeman
brianteeman - comment - 14 Apr 2016

See #9919 for an example


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9919.

avatar brianteeman brianteeman - change - 14 Apr 2016
Labels Added: ?
avatar brianteeman brianteeman - change - 15 Apr 2016
Category Front End Front End Libraries
avatar SharkyKZ
SharkyKZ - comment - 15 Apr 2016

The image is so small, it doesn't really affect page rendering. But in case it is decided to add the dimensions, it should be done in template CSS.

avatar brianteeman
brianteeman - comment - 8 May 2016

I am closing this at this time. If code is provided (a pull request) it can always be re-examined.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/9919.

avatar brianteeman brianteeman - change - 8 May 2016
Status New Closed
Closed_Date 0000-00-00 00:00:00 2016-05-08 11:09:30
Closed_By brianteeman
avatar brianteeman brianteeman - close - 8 May 2016

Add a Comment

Login with GitHub to post a comment