src/Modifiers/ImageModifier.php
public function save($path)
    {

        switch ( $this->imageType ) {
            case IMAGETYPE_GIF:
                $returnData = imagegif( $this->image, $path );
                break;

            case IMAGETYPE_PNG:
                $returnData = imagepng( $this->image, $path );
                break;

            case IMAGETYPE_JPEG:
                $returnData = imagejpeg( $this->image, $path );
                break;

            case IMAGETYPE_BMP:
                $returnData = imagewbmp( $this->image, $path );
                break;

            // If the image is not one of the previous mimetype
            // We throw an exception
            default:
                throw new Exception( sprintf( 'This MimeType is not supported: %s. Image processed: %s', image_type_to_mime_type( $this->imageType ), $this->originalImagePath ) );
                break;
        }

        // Return this for chaning
        return $this;
    }
public function save($path)
    {

        switch ( $this->imageType ) {
            case IMAGETYPE_GIF:
                $returnData = imagegif( $this->image, $path );
                break;

            case IMAGETYPE_PNG:
                $returnData = imagepng( $this->image, $path );
                break;

            case IMAGETYPE_JPEG:
                $returnData = imagejpeg( $this->image, $path );
                break;

            case IMAGETYPE_BMP:
                $returnData = imagewbmp( $this->image, $path );
                break;

            // If the image is not one of the previous mimetype
            // We throw an exception
            default:
                throw new Exception( sprintf( 'This MimeType is not supported: %s. Image processed: %s', image_type_to_mime_type( $this->imageType ), $this->originalImagePath ) );
                break;
        }

        // Return this for chaning
        return $this;
    }
public function save ( $ path ) { switch ( $ this -> imageType ) { case IMAGETYPE_GIF : $ returnData = imagegif ( $ this -> image , $ path ) ; break ; case IMAGETYPE_PNG : $ returnData = imagepng ( $ this -> image , $ path ) ; break ; case IMAGETYPE_JPEG : $ returnData = imagejpeg ( $ this -> image , $ path ) ; break ; case IMAGETYPE_BMP : $ returnData = imagewbmp ( $ this -> image , $ path ) ; break ; // If the image is not one of the previous mimetype // We throw an exception default : throw new Exception ( sprintf ( 'This MimeType is not supported: %s. Image processed: %s' , image_type_to_mime_type ( $ this -> imageType ) , $ this -> originalImagePath ) ) ; break ; } // Return this for chaning return $ this ; }
Save the working image to the new path

@return $this
Save the working image to the new path