public function dataUrl($type = 'jpeg')
    {
        $type      = $this->getType($type);
        $imageFunc = 'image' . $type;

        ob_start();

        $imageFunc($this->newImage);

        $data = ob_get_contents();

        ob_end_clean();

        $this->destroyAll();

        $dataUrl = 'data:image/'. $type . ';base64,' . base64_encode($data);

        return $dataUrl;
    }
public function dataUrl($type = 'jpeg')
    {
        $type      = $this->getType($type);
        $imageFunc = 'image' . $type;

        ob_start();

        $imageFunc($this->newImage);

        $data = ob_get_contents();

        ob_end_clean();

        $this->destroyAll();

        $dataUrl = 'data:image/'. $type . ';base64,' . base64_encode($data);

        return $dataUrl;
    }
public function dataUrl ( $ type = 'jpeg' ) { $ type = $ this -> getType ( $ type ) ; $ imageFunc = 'image' . $ type ; ob_start ( ) ; $ imageFunc ( $ this -> newImage ) ; $ data = ob_get_contents ( ) ; ob_end_clean ( ) ; $ this -> destroyAll ( ) ; $ dataUrl = 'data:image/' . $ type . ';base64,' . base64_encode ( $ data ) ; return $ dataUrl ; }
Image to data url base64

@param string $type jpeg
@return string
Image to data url base64