|
@@ 308-314 (lines=7) @@
|
| 305 |
|
$left = round(($scaledWidth - $width) / 2); |
| 306 |
|
$top = 0; |
| 307 |
|
|
| 308 |
|
if ($scaledWidth < $width) { |
| 309 |
|
$coefficient = $originalWidth / $width; |
| 310 |
|
$scaledHeight = round($originalHeight / $coefficient); |
| 311 |
|
|
| 312 |
|
$left = 0; |
| 313 |
|
$top = round(($scaledHeight - $height) / 2); |
| 314 |
|
} |
| 315 |
|
|
| 316 |
|
} else { |
| 317 |
|
|
|
@@ 316-323 (lines=8) @@
|
| 313 |
|
$top = round(($scaledHeight - $height) / 2); |
| 314 |
|
} |
| 315 |
|
|
| 316 |
|
} else { |
| 317 |
|
|
| 318 |
|
$coefficient = $originalHeight / $height; |
| 319 |
|
$scaledWidth = round($originalWidth / $coefficient); |
| 320 |
|
|
| 321 |
|
$left = round(($scaledWidth - $width) / 2); |
| 322 |
|
$top = 0; |
| 323 |
|
} |
| 324 |
|
|
| 325 |
|
} else { |
| 326 |
|
|
|
@@ 335-343 (lines=9) @@
|
| 332 |
|
$left = 0; |
| 333 |
|
$top = round(($scaledHeight - $height) / 2); |
| 334 |
|
|
| 335 |
|
} else { |
| 336 |
|
|
| 337 |
|
$coefficient = $originalHeight / $height; |
| 338 |
|
$scaledWidth = round($originalWidth / $coefficient); |
| 339 |
|
|
| 340 |
|
$left = round(($scaledWidth - $width) / 2); |
| 341 |
|
$top = 0; |
| 342 |
|
|
| 343 |
|
} |
| 344 |
|
} |
| 345 |
|
|
| 346 |
|
$image->resize($resizeWidth, $resizeHeight, Image::FILL); |