1 | <?php |
||
5 | class ImageResizer extends ImageManipulator |
||
6 | { |
||
7 | /** |
||
8 | * @var resource |
||
9 | */ |
||
10 | private $_image; |
||
11 | |||
12 | public function fromString($image) |
||
18 | |||
19 | public function toString($format = self::FORMAT_PNG, $quality = null) |
||
23 | |||
24 | public function scaleToFit($width, $height, $force = false) |
||
28 | |||
29 | public function scaleToCover($width, $height, $force = false) |
||
33 | |||
34 | /** |
||
35 | * @param int $width Target width |
||
36 | * @param int $height Target height |
||
37 | * @param bool $toFit If true, image fill fit to given dimensions, if false, it will cover them |
||
38 | * @param bool $force If true, image will be resized even if target dimensions are larger than original |
||
39 | */ |
||
40 | protected function scale($width, $height, $toFit, $force) |
||
71 | |||
72 | protected function _getWidth() |
||
76 | |||
77 | protected function _getHeight() |
||
81 | } |