| @@ 3562-3584 (lines=23) @@ | ||
| 3559 | $height = $matches[4][$key]; |
|
| 3560 | ||
| 3561 | // If the dimensions are still not fixed - we need to check the actual image. |
|
| 3562 | if (($width == -1 && $sig_limits[5]) || ($height == -1 && $sig_limits[6])) |
|
| 3563 | { |
|
| 3564 | $sizes = url_image_size($matches[7][$key]); |
|
| 3565 | if (is_array($sizes)) |
|
| 3566 | { |
|
| 3567 | // Too wide? |
|
| 3568 | if ($sizes[0] > $sig_limits[5] && $sig_limits[5]) |
|
| 3569 | { |
|
| 3570 | $width = $sig_limits[5]; |
|
| 3571 | $sizes[1] = $sizes[1] * ($width / $sizes[0]); |
|
| 3572 | } |
|
| 3573 | // Too high? |
|
| 3574 | if ($sizes[1] > $sig_limits[6] && $sig_limits[6]) |
|
| 3575 | { |
|
| 3576 | $height = $sig_limits[6]; |
|
| 3577 | if ($width == -1) |
|
| 3578 | $width = $sizes[0]; |
|
| 3579 | $width = $width * ($height / $sizes[1]); |
|
| 3580 | } |
|
| 3581 | elseif ($width != -1) |
|
| 3582 | $height = $sizes[1]; |
|
| 3583 | } |
|
| 3584 | } |
|
| 3585 | ||
| 3586 | // Did we come up with some changes? If so remake the string. |
|
| 3587 | if ($width != -1 || $height != -1) |
|
| @@ 1088-1110 (lines=23) @@ | ||
| 1085 | $height = $matches[4][$key]; |
|
| 1086 | ||
| 1087 | // If the dimensions are still not fixed - we need to check the actual image. |
|
| 1088 | if (($width == -1 && $sig_limits[5]) || ($height == -1 && $sig_limits[6])) |
|
| 1089 | { |
|
| 1090 | $sizes = url_image_size($matches[7][$key]); |
|
| 1091 | if (is_array($sizes)) |
|
| 1092 | { |
|
| 1093 | // Too wide? |
|
| 1094 | if ($sizes[0] > $sig_limits[5] && $sig_limits[5]) |
|
| 1095 | { |
|
| 1096 | $width = $sig_limits[5]; |
|
| 1097 | $sizes[1] = $sizes[1] * ($width / $sizes[0]); |
|
| 1098 | } |
|
| 1099 | // Too high? |
|
| 1100 | if ($sizes[1] > $sig_limits[6] && $sig_limits[6]) |
|
| 1101 | { |
|
| 1102 | $height = $sig_limits[6]; |
|
| 1103 | if ($width == -1) |
|
| 1104 | $width = $sizes[0]; |
|
| 1105 | $width = $width * ($height / $sizes[1]); |
|
| 1106 | } |
|
| 1107 | elseif ($width != -1) |
|
| 1108 | $height = $sizes[1]; |
|
| 1109 | } |
|
| 1110 | } |
|
| 1111 | ||
| 1112 | // Did we come up with some changes? If so remake the string. |
|
| 1113 | if ($width != -1 || $height != -1) |
|