| @@ 2356-2363 (lines=8) @@ | ||
| 2353 | $info[1] = $h; |
|
| 2354 | } |
|
| 2355 | if ($w && $h) { |
|
| 2356 | if ($max) { |
|
| 2357 | $ratio = $info[0] / $info[1]; |
|
| 2358 | if ($h * $ratio > $w) { |
|
| 2359 | $h = round($w / $ratio); |
|
| 2360 | } else { |
|
| 2361 | $w = round($h * $ratio); |
|
| 2362 | } |
|
| 2363 | } |
|
| 2364 | if ($crs) { |
|
| 2365 | $ratio = $info[0] / $info[1]; |
|
| 2366 | if ($h * $ratio < $w) { |
|
| @@ 2364-2371 (lines=8) @@ | ||
| 2361 | $w = round($h * $ratio); |
|
| 2362 | } |
|
| 2363 | } |
|
| 2364 | if ($crs) { |
|
| 2365 | $ratio = $info[0] / $info[1]; |
|
| 2366 | if ($h * $ratio < $w) { |
|
| 2367 | $h = round($w / $ratio); |
|
| 2368 | } else { |
|
| 2369 | $w = round($h * $ratio); |
|
| 2370 | } |
|
| 2371 | } |
|
| 2372 | $info[0] = $w; |
|
| 2373 | $info[1] = $h; |
|
| 2374 | } |
|