eZ\Bundle\EzPublishCoreBundle\Imagine\Filter\Loader\ScaleDownOnlyFilterLoader::load PHP Method

load() public method

Loads and applies a filter on the given image.
public load ( Imagine\Image\ImageInterface $image, array $options = [] ) : Imagine\Image\ImageInterface
$image Imagine\Image\ImageInterface
$options array Numerically indexed array. First entry is width, second is height.
return Imagine\Image\ImageInterface
    public function load(ImageInterface $image, array $options = array())
    {
        if (count($options) < 2) {
            throw new InvalidArgumentException('Missing width and/or height options');
        }
        return $this->innerLoader->load($image, array('size' => $options, 'mode' => ImageInterface::THUMBNAIL_INSET));
    }

Usage Example

 public function testLoad()
 {
     $options = array(123, 456);
     $image = $this->getMock('\\Imagine\\Image\\ImageInterface');
     $this->innerLoader->expects($this->once())->method('load')->with($image, $this->equalTo(array('size' => $options, 'mode' => ImageInterface::THUMBNAIL_INSET)))->will($this->returnValue($image));
     $this->assertSame($image, $this->loader->load($image, $options));
 }
ScaleDownOnlyFilterLoader