public function save($path, $type = null)
    {
        #imagepng() - Output a PNG image to either the browser or a file
        #imagegif() - Output image to browser or file
        #imagewbmp() - Output image to browser or file
        #imagejpeg() - Output image to browser or file
        
        if (!$type) {
            $type = $this->type;
        }

        switch ($type) {
            case 'gif':
                imagegif($this->resource, $path);
                break;
            case 'png':
                $quality = (100 - $this->quality) / 10;

                if ($quality > 9) {
                    $quality = 9;
                }

                imagepng($this->resource, $path, $quality);
                break;
            case 'bmp':
            case 'wbmp':
                imagewbmp($this->resource, $path, $this->quality);
                break;
            case 'jpg':
            case 'jpeg':
            case 'pjpeg':
            default:
                imagejpeg($this->resource, $path, $this->quality);
                break;

        }

        return $this;
    }
public function save($path, $type = null)
    {
        #imagepng() - Output a PNG image to either the browser or a file
        #imagegif() - Output image to browser or file
        #imagewbmp() - Output image to browser or file
        #imagejpeg() - Output image to browser or file
        
        if (!$type) {
            $type = $this->type;
        }

        switch ($type) {
            case 'gif':
                imagegif($this->resource, $path);
                break;
            case 'png':
                $quality = (100 - $this->quality) / 10;

                if ($quality > 9) {
                    $quality = 9;
                }

                imagepng($this->resource, $path, $quality);
                break;
            case 'bmp':
            case 'wbmp':
                imagewbmp($this->resource, $path, $this->quality);
                break;
            case 'jpg':
            case 'jpeg':
            case 'pjpeg':
            default:
                imagejpeg($this->resource, $path, $this->quality);
                break;

        }

        return $this;
    }
public function save ( $ path , $ type = null ) { #imagepng() - Output a PNG image to either the browser or a file #imagegif() - Output image to browser or file #imagewbmp() - Output image to browser or file #imagejpeg() - Output image to browser or file if ( ! $ type ) { $ type = $ this -> type ; } switch ( $ type ) { case 'gif' : imagegif ( $ this -> resource , $ path ) ; break ; case 'png' : $ quality = ( 100 - $ this -> quality ) / 10 ; if ( $ quality > 9 ) { $ quality = 9 ; } imagepng ( $ this -> resource , $ path , $ quality ) ; break ; case 'bmp' : case 'wbmp' : imagewbmp ( $ this -> resource , $ path , $ this -> quality ) ; break ; case 'jpg' : case 'jpeg' : case 'pjpeg' : default : imagejpeg ( $ this -> resource , $ path , $ this -> quality ) ; break ; } return $ this ; }
Saves the image data to a file

@param *string     $path The path to save to
@param string|null $type The render type

@return Eden\Image\Index
Saves the image data to a file