|
@@ 236-245 (lines=10) @@
|
| 233 |
|
* |
| 234 |
|
* @return mixed|string |
| 235 |
|
*/ |
| 236 |
|
public function cropImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $width = '', $height = null) |
| 237 |
|
{ |
| 238 |
|
$styleName = 'custom_crop_' . $width . '_' . $height; |
| 239 |
|
|
| 240 |
|
if (!empty($this->imageManager)) { |
| 241 |
|
$this->imageManager->createCustomStyledImage($image, $styleName); |
| 242 |
|
} |
| 243 |
|
|
| 244 |
|
return $this->renderImage($environment, $image, $styleName); |
| 245 |
|
} |
| 246 |
|
|
| 247 |
|
/** |
| 248 |
|
* @param \Twig_Environment $environment |
|
@@ 255-264 (lines=10) @@
|
| 252 |
|
* |
| 253 |
|
* @return mixed|string |
| 254 |
|
*/ |
| 255 |
|
public function scaleImage(\Twig_Environment $environment, ResponsiveImageInterface $image, $width = '', $height = '') |
| 256 |
|
{ |
| 257 |
|
$styleName = 'custom_scale_' . $width . '_' . $height; |
| 258 |
|
|
| 259 |
|
if (!empty($this->imageManager)) { |
| 260 |
|
$this->imageManager->createCustomStyledImage($image, $styleName); |
| 261 |
|
} |
| 262 |
|
|
| 263 |
|
return $this->renderImage($environment, $image, $styleName); |
| 264 |
|
} |
| 265 |
|
|
| 266 |
|
/** |
| 267 |
|
* @param \Twig_Environment $environment |