Summary:
Since CGSmartImage v1.22.5 the width and height attributes are missing from the
tag.
Detailed Description:
I upgrade CGSmartImage from v1.22.4 to v1.22.5 suddenly images scaled with
CGSmartImage do not have a width and height attribute anymore:
This is normal behaviour when using the "noauto" parameter: "CGSmartImage will
normally automatically fill the width and height attributes of the generated img
tag with the size of the image generated from the last filter. the noauto
parameter can prevent this.". In my testcase I did not use the noauto parameter.
======= Test case:
{CGSmartImage src=$images[0]->file notag=0 filter_resize='w,100' noauto=1
noembed=1}
{CGSmartImage src=$images[0]->file notag=0 filter_resize='w,100' noauto=0
noembed=1}
{CGSmartImage src=$images[0]->file notag=0 filter_resize='w,100' noembed=1}
======= Why does this happen?
Some how setting the width and height is commented out in CGSmartImage v1.22.5 :
/modules/CGSmartImage/lib/class.cgsi_utils.php line 880 in v1.22.4 this was not
the case.
/*
not needed now.
if( $dest_fname && !$opp['noauto'] ) {
$details = getimagesize($dest_fname);
if( is_array($details) ) {
$outp['width'] = (int)$details[0];
$outp['height'] = (int)$details[1];
}
}
*/
======= Solution:
- code fix or rollback to v1.22.4