Neos.Media/Classes/Domain/Model/Adjustment/ResizeImageAdjustment.php
protected function resize(ImagineImageInterface $image, $mode = ImageInterface::RATIOMODE_INSET, $filter = ImagineImageInterface::FILTER_UNDEFINED)
    {
        if ($mode !== ImageInterface::RATIOMODE_INSET &&
            $mode !== ImageInterface::RATIOMODE_OUTBOUND
        ) {
            throw new \InvalidArgumentException('Invalid mode specified');
        }

        $imageSize = $image->getSize();
        $requestedDimensions = $this->calculateDimensions($imageSize);

        $image->strip();

        $resizeDimensions = $requestedDimensions;
        if ($mode === ImageInterface::RATIOMODE_OUTBOUND) {
            $resizeDimensions = $this->calculateOutboundScalingDimensions($imageSize, $requestedDimensions);
        }

        $image->resize($resizeDimensions, $filter);

        if ($mode === ImageInterface::RATIOMODE_OUTBOUND) {
            $image->crop(new Point(
                max(0, round(($resizeDimensions->getWidth() - $requestedDimensions->getWidth()) / 2)),
                max(0, round(($resizeDimensions->getHeight() - $requestedDimensions->getHeight()) / 2))
            ), $requestedDimensions);
        }

        return $image;
    }
protected function resize(ImagineImageInterface $image, $mode = ImageInterface::RATIOMODE_INSET, $filter = ImagineImageInterface::FILTER_UNDEFINED)
    {
        if ($mode !== ImageInterface::RATIOMODE_INSET &&
            $mode !== ImageInterface::RATIOMODE_OUTBOUND
        ) {
            throw new \InvalidArgumentException('Invalid mode specified');
        }

        $imageSize = $image->getSize();
        $requestedDimensions = $this->calculateDimensions($imageSize);

        $image->strip();

        $resizeDimensions = $requestedDimensions;
        if ($mode === ImageInterface::RATIOMODE_OUTBOUND) {
            $resizeDimensions = $this->calculateOutboundScalingDimensions($imageSize, $requestedDimensions);
        }

        $image->resize($resizeDimensions, $filter);

        if ($mode === ImageInterface::RATIOMODE_OUTBOUND) {
            $image->crop(new Point(
                max(0, round(($resizeDimensions->getWidth() - $requestedDimensions->getWidth()) / 2)),
                max(0, round(($resizeDimensions->getHeight() - $requestedDimensions->getHeight()) / 2))
            ), $requestedDimensions);
        }

        return $image;
    }
protected function resize ( ImagineImageInterface $ image , $ mode = ImageInterface :: RATIOMODE_INSET , $ filter = ImagineImageInterface :: FILTER_UNDEFINED ) { if ( $ mode !== ImageInterface :: RATIOMODE_INSET && $ mode !== ImageInterface :: RATIOMODE_OUTBOUND ) { throw new \ InvalidArgumentException ( 'Invalid mode specified' ) ; } $ imageSize = $ image -> getSize ( ) ; $ requestedDimensions = $ this -> calculateDimensions ( $ imageSize ) ; $ image -> strip ( ) ; $ resizeDimensions = $ requestedDimensions ; if ( $ mode === ImageInterface :: RATIOMODE_OUTBOUND ) { $ resizeDimensions = $ this -> calculateOutboundScalingDimensions ( $ imageSize , $ requestedDimensions ) ; } $ image -> resize ( $ resizeDimensions , $ filter ) ; if ( $ mode === ImageInterface :: RATIOMODE_OUTBOUND ) { $ image -> crop ( new Point ( max ( 0 , round ( ( $ resizeDimensions -> getWidth ( ) - $ requestedDimensions -> getWidth ( ) ) / 2 ) ) , max ( 0 , round ( ( $ resizeDimensions -> getHeight ( ) - $ requestedDimensions -> getHeight ( ) ) / 2 ) ) ) , $ requestedDimensions ) ; } return $ image ; }
Executes the actual resizing operation on the Imagine image.
In case of an outbound resize the image will be resized and cropped.

@param ImagineImageInterface $image
@param string $mode
@param string $filter
@return \Imagine\Image\ManipulatorInterface
Executes the actual resizing operation on the Imagine image . In case of an outbound resize the image will be resized and cropped .