public function save($path = null, $quality = null)
    {
        $path = is_null($path) ? $this->basePath() : $path;

        if (is_null($path)) {
            throw new Exception\NotWritableException(
                "Can't write to undefined path."
            );
        }

        $data = $this->encode(pathinfo($path, PATHINFO_EXTENSION), $quality);
        $saved = @file_put_contents($path, $data);

        if ($saved === false) {
            throw new Exception\NotWritableException(
                "Can't write image data to path ({$path})"
            );
        }

        // set new file info
        $this->setFileInfoFromPath($path);

        return $this;
    }
public function save($path = null, $quality = null)
    {
        $path = is_null($path) ? $this->basePath() : $path;

        if (is_null($path)) {
            throw new Exception\NotWritableException(
                "Can't write to undefined path."
            );
        }

        $data = $this->encode(pathinfo($path, PATHINFO_EXTENSION), $quality);
        $saved = @file_put_contents($path, $data);

        if ($saved === false) {
            throw new Exception\NotWritableException(
                "Can't write image data to path ({$path})"
            );
        }

        // set new file info
        $this->setFileInfoFromPath($path);

        return $this;
    }
public function save ( $ path = null , $ quality = null ) { $ path = is_null ( $ path ) ? $ this -> basePath ( ) : $ path ; if ( is_null ( $ path ) ) { throw new Exception \ NotWritableException ( "Can't write to undefined path." ) ; } $ data = $ this -> encode ( pathinfo ( $ path , PATHINFO_EXTENSION ) , $ quality ) ; $ saved = @ file_put_contents ( $ path , $ data ) ; if ( $ saved === false ) { throw new Exception \ NotWritableException ( "Can't write image data to path ({$path})" ) ; } // set new file info $ this -> setFileInfoFromPath ( $ path ) ; return $ this ; }
Saves encoded image in filesystem

@param  string  $path
@param  int     $quality
@return \Intervention\Image\Image
Saves encoded image in filesystem