@@ 100-114 (lines=15) @@ | ||
97 | * |
|
98 | * @throws InvalidManipulation |
|
99 | */ |
|
100 | public function crop(string $cropMethod, int $width, int $height) |
|
101 | { |
|
102 | if (! $this->validateManipulation($cropMethod, 'crop')) { |
|
103 | throw InvalidManipulation::invalidParameter( |
|
104 | 'cropmethod', |
|
105 | $cropMethod, |
|
106 | $this->getValidManipulationOptions('crop') |
|
107 | ); |
|
108 | } |
|
109 | ||
110 | $this->width($width); |
|
111 | $this->height($height); |
|
112 | ||
113 | return $this->addManipulation('crop', $cropMethod); |
|
114 | } |
|
115 | ||
116 | /** |
|
117 | * @param int $width |
|
@@ 196-210 (lines=15) @@ | ||
193 | * |
|
194 | * @throws InvalidManipulation |
|
195 | */ |
|
196 | public function fit(string $fitMethod, int $width, int $height) |
|
197 | { |
|
198 | if (! $this->validateManipulation($fitMethod, 'fit')) { |
|
199 | throw InvalidManipulation::invalidParameter( |
|
200 | 'fit', |
|
201 | $fitMethod, |
|
202 | $this->getValidManipulationOptions('fit') |
|
203 | ); |
|
204 | } |
|
205 | ||
206 | $this->width($width); |
|
207 | $this->height($height); |
|
208 | ||
209 | return $this->addManipulation('fit', $fitMethod); |
|
210 | } |
|
211 | ||
212 | /** |
|
213 | * @param int $ratio A value between 1 and 8 |