public function resizeImage($original, $path, $width, $height)
    {
        $original = $this->getFullPath($original);

        // Create folder if it dosn't exist
        $pathArray = explode('/', $path);
        array_pop($pathArray);
        $folder = implode('/', $pathArray);
        if (! file_exists($folder)) {
            mkdir($folder, 0777, true);
        }

        $file = \File::get($original);

        $img = \Image::make($file)->resize($width, $height, function ($constraint) {
            $constraint->aspectRatio();
            $constraint->upsize();
        });

        $img->save($path);

        return $this->showFile($path);
    }
public function resizeImage($original, $path, $width, $height)
    {
        $original = $this->getFullPath($original);

        // Create folder if it dosn't exist
        $pathArray = explode('/', $path);
        array_pop($pathArray);
        $folder = implode('/', $pathArray);
        if (! file_exists($folder)) {
            mkdir($folder, 0777, true);
        }

        $file = \File::get($original);

        $img = \Image::make($file)->resize($width, $height, function ($constraint) {
            $constraint->aspectRatio();
            $constraint->upsize();
        });

        $img->save($path);

        return $this->showFile($path);
    }
public function resizeImage ( $ original , $ path , $ width , $ height ) { $ original = $ this -> getFullPath ( $ original ) ; // Create folder if it dosn't exist $ pathArray = explode ( '/' , $ path ) ; array_pop ( $ pathArray ) ; $ folder = implode ( '/' , $ pathArray ) ; if ( ! file_exists ( $ folder ) ) { mkdir ( $ folder , 0777 , true ) ; } $ file = \ File :: get ( $ original ) ; $ img = \ Image :: make ( $ file ) -> resize ( $ width , $ height , function ( $ constraint ) { $ constraint -> aspectRatio ( ) ; $ constraint -> upsize ( ) ; } ) ; $ img -> save ( $ path ) ; return $ this -> showFile ( $ path ) ; }
Resize the image.

@author Jonas Schwartz <josc@nodes.dk>
@param string $original
@param string $path
@param int|null $width
@param int|null $height
@return mixed
Resize the image .