src/Support/Image/Resizer.php
public function resize(SplFileInfo $file, array $options)
    {
        $filePath = $file->getRealPath();

        list($width, $height, $option) = $this->parseOptionDimensions($options);

        $method = 'resize' . ucfirst($option);

        // Custom resize (that still expects imagine to be used)
        if ($method == 'resizeCustom') {

            $callable = $options['dimensions'];

            $this
                ->resizeCustom($file, $callable)
                ->save($filePath, $this->getConvertOptions($options));

            return true;
        }

        $image = $this->imagine->open($file->getRealPath());

        $this->$method($image, $width, $height)
           ->save($filePath, $this->getConvertOptions($options));

        return true;
    }
public function resize(SplFileInfo $file, array $options)
    {
        $filePath = $file->getRealPath();

        list($width, $height, $option) = $this->parseOptionDimensions($options);

        $method = 'resize' . ucfirst($option);

        // Custom resize (that still expects imagine to be used)
        if ($method == 'resizeCustom') {

            $callable = $options['dimensions'];

            $this
                ->resizeCustom($file, $callable)
                ->save($filePath, $this->getConvertOptions($options));

            return true;
        }

        $image = $this->imagine->open($file->getRealPath());

        $this->$method($image, $width, $height)
           ->save($filePath, $this->getConvertOptions($options));

        return true;
    }
public function resize ( SplFileInfo $ file , array $ options ) { $ filePath = $ file -> getRealPath ( ) ; list ( $ width , $ height , $ option ) = $ this -> parseOptionDimensions ( $ options ) ; $ method = 'resize' . ucfirst ( $ option ) ; // Custom resize (that still expects imagine to be used) if ( $ method == 'resizeCustom' ) { $ callable = $ options [ 'dimensions' ] ; $ this -> resizeCustom ( $ file , $ callable ) -> save ( $ filePath , $ this -> getConvertOptions ( $ options ) ) ; return true ; } $ image = $ this -> imagine -> open ( $ file -> getRealPath ( ) ) ; $ this -> $ method ( $ image , $ width , $ height ) -> save ( $ filePath , $ this -> getConvertOptions ( $ options ) ) ; return true ; }
Resize an image using given options.

@param SplFileInfo $file
@param array       $options
@return bool
Resize an image using given options .