src/Image/Driver/Gd.php
public function make()
    {
        $ext = strtolower(strrchr($this->path, '.'));
        $path = storage_path('app/public/') . $this->path;
        switch ($ext) {
            case '.jpg':
            case '.jpeg':
                $this->image = @imagecreatefromjpeg($path);
                break;
            case '.gif':
                $this->image = @imagecreatefromgif($path);
                break;
            case '.png':
                $this->image = @imagecreatefrompng($path);
                break;
            default:
                $this->image = false;
                break;
        }

        if (false === $this->image) {
            throw new ImageNotFoundException('Image extension not supported!');
        }
        $this->width = imagesx($this->image);
        $this->height = imagesy($this->image);

        return $this;
    }
public function make()
    {
        $ext = strtolower(strrchr($this->path, '.'));
        $path = storage_path('app/public/') . $this->path;
        switch ($ext) {
            case '.jpg':
            case '.jpeg':
                $this->image = @imagecreatefromjpeg($path);
                break;
            case '.gif':
                $this->image = @imagecreatefromgif($path);
                break;
            case '.png':
                $this->image = @imagecreatefrompng($path);
                break;
            default:
                $this->image = false;
                break;
        }

        if (false === $this->image) {
            throw new ImageNotFoundException('Image extension not supported!');
        }
        $this->width = imagesx($this->image);
        $this->height = imagesy($this->image);

        return $this;
    }
public function make ( ) { $ ext = strtolower ( strrchr ( $ this -> path , '.' ) ) ; $ path = storage_path ( 'app/public/' ) . $ this -> path ; switch ( $ ext ) { case '.jpg' : case '.jpeg' : $ this -> image = @ imagecreatefromjpeg ( $ path ) ; break ; case '.gif' : $ this -> image = @ imagecreatefromgif ( $ path ) ; break ; case '.png' : $ this -> image = @ imagecreatefrompng ( $ path ) ; break ; default : $ this -> image = false ; break ; } if ( false === $ this -> image ) { throw new ImageNotFoundException ( 'Image extension not supported!' ) ; } $ this -> width = imagesx ( $ this -> image ) ; $ this -> height = imagesy ( $ this -> image ) ; return $ this ; }
Make the Image as GD Resource and return self
@return self $this
Make the Image as GD Resource and return self