private function outputBuffer($filename = null, $output = false)
    {
        if (!$this->resource) {
            return $this;
        }

        if ($output) {
            $filename = null;
        } elseif (empty($filename) && $this->isLocal()) {
            $filename = $this->filename;
        } elseif (empty($filename) && $this->isExternal()) {
            $filename = $this->name;
        }

        if ($output) {
            header('Content-type: ' . $this->mimetype);
            ob_start();
        }

        $this->outputBufferByImage($filename, $this->quality);

        if ($output) {
            ob_end_flush();
        }

        if (!$this->preserve) {
            $this->destroy();
        }

        return $this;
    }
private function outputBuffer($filename = null, $output = false)
    {
        if (!$this->resource) {
            return $this;
        }

        if ($output) {
            $filename = null;
        } elseif (empty($filename) && $this->isLocal()) {
            $filename = $this->filename;
        } elseif (empty($filename) && $this->isExternal()) {
            $filename = $this->name;
        }

        if ($output) {
            header('Content-type: ' . $this->mimetype);
            ob_start();
        }

        $this->outputBufferByImage($filename, $this->quality);

        if ($output) {
            ob_end_flush();
        }

        if (!$this->preserve) {
            $this->destroy();
        }

        return $this;
    }
private function outputBuffer ( $ filename = null , $ output = false ) { if ( ! $ this -> resource ) { return $ this ; } if ( $ output ) { $ filename = null ; } elseif ( empty ( $ filename ) && $ this -> isLocal ( ) ) { $ filename = $ this -> filename ; } elseif ( empty ( $ filename ) && $ this -> isExternal ( ) ) { $ filename = $ this -> name ; } if ( $ output ) { header ( 'Content-type: ' . $ this -> mimetype ) ; ob_start ( ) ; } $ this -> outputBufferByImage ( $ filename , $ this -> quality ) ; if ( $ output ) { ob_end_flush ( ) ; } if ( ! $ this -> preserve ) { $ this -> destroy ( ) ; } return $ this ; }
Output the image to either the browser or a file.

@access private
@param string $filename [Optional] Path to save image
@param bool $output [Optional] true to output the image.
@return \GImage\Image | resource
Output the image to either the browser or a file .