for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Liip\ImagineBundle\Imagine\Filter\Loader;
use Imagine\Filter\Basic\Crop;
use Imagine\Image\Box;
use Imagine\Image\Point;
use Imagine\Image\ImageInterface;
class CropFilterLoader implements LoaderInterface
{
/**
* {@inheritdoc}
*/
public function load(ImageInterface $image, array $options = array())
$x = isset($options['start'][0]) ? $options['start'][0] : null;
$y = isset($options['start'][1]) ? $options['start'][1] : null;
$width = isset($options['size'][0]) ? $options['size'][0] : null;
$height = isset($options['size'][1]) ? $options['size'][1] : null;
$filter = new Crop(new Point($x, $y), new Box($width, $height));
$image = $filter->apply($image);
return $image;
}