continue;
}
}
-
-
+
foreach ($xpath->query('//img[@src]') as $a) {
$src = $a->getAttribute('src');
$matches = array();
if (!isset($imap[$matches[1]])) {
continue;
}
- $width = $a->hasAttribute('width') ? ((int)$a->getAttribute('width')) : false;
- $height= $a->hasAttribute('height') ? ((int)$a->getAttribute('height')) : false;
+ $width = $a->hasAttribute('width') ? $a->getAttribute('width') : false;
+ $height= $a->hasAttribute('height') ? $a->getAttribute('height') : false;
+ $width = $width == false || strpos($width,'%') != -1 ? false : (int) $width;
+ $height = $height== false || strpos($height,'%') != -1 ? false : (int) $height;
+
// convert into scaled...
switch(true) {
case ($width === false && $height == false):