Image.php
public function create() {
        switch($this->info[2]) {
            case IMAGETYPE_JPEG:
                $this->resource = imagecreatefromjpeg($this->file);
                break;
            case IMAGETYPE_GIF:
                $this->resource = imagecreatefromgif($this->file);
                break;
            case IMAGETYPE_PNG:
                $this->resource = imagecreatefrompng($this->file);
                break;
            default:
                throw new Exception('Image type is not supported');
                break;
        }
    }
public function create() {
        switch($this->info[2]) {
            case IMAGETYPE_JPEG:
                $this->resource = imagecreatefromjpeg($this->file);
                break;
            case IMAGETYPE_GIF:
                $this->resource = imagecreatefromgif($this->file);
                break;
            case IMAGETYPE_PNG:
                $this->resource = imagecreatefrompng($this->file);
                break;
            default:
                throw new Exception('Image type is not supported');
                break;
        }
    }
public function create ( ) { switch ( $ this -> info [ 2 ] ) { case IMAGETYPE_JPEG : $ this -> resource = imagecreatefromjpeg ( $ this -> file ) ; break ; case IMAGETYPE_GIF : $ this -> resource = imagecreatefromgif ( $ this -> file ) ; break ; case IMAGETYPE_PNG : $ this -> resource = imagecreatefrompng ( $ this -> file ) ; break ; default : throw new Exception ( 'Image type is not supported' ) ; break ; } }
Create an image resource
Create an image resource