1
0
mirror of https://github.com/e107inc/e107.git synced 2025-03-14 01:19:44 +01:00

Don't include srcset if width and height are 0.

This commit is contained in:
Cameron 2017-01-23 13:16:11 -08:00
parent fe4574d4fe
commit 39bd9ba334

View File

@ -2584,6 +2584,16 @@ class e_parse extends e_parser
$parm['crop'] = null;
}
$defaultWidth = $this->thumbWidth();
$defaultHeight = $this->thumbHeight();
if(empty($defaultWidth) && empty($defaultHeight))
{
return false;
}
$parms = array('w'=>$width,'h'=>$height,'crop'=> $parm['crop'],'x'=>$parm['x'], 'aw'=>$parm['aw'],'ah'=>$parm['ah']);
// $parms = !empty($this->thumbCrop) ? array('aw' => $width, 'ah' => $height, 'x'=>$encode) : array('w' => $width, 'h' => $height, 'x'=>$encode );
@ -3906,10 +3916,18 @@ class e_parser
unset($parm['src']);
$path = $tp->thumbUrl($file,$parm);
$srcSetParm = $parm;
$srcSetParm['size'] = ($parm['w'] < 100) ? '4x' : '2x';
$parm['srcset'] = $tp->thumbSrcSet($file, $srcSetParm);
if(empty($parm['w']) && empty($parm['h']))
{
$parm['srcset'] = false;
}
else
{
$srcSetParm = $parm;
$srcSetParm['size'] = ($parm['w'] < 100) ? '4x' : '2x';
$parm['srcset'] = $tp->thumbSrcSet($file, $srcSetParm);
}
}
elseif(strpos($file,'http')===0)