public function get($format = 'png')
    {
        $this->create();

        if ($format == 'jpg') {
            $format = 'jpeg';
        }

        if (!in_array($format, $this->image_types_available)) {
            $format = $this->image_type;
        }

        if (!function_exists('image'.$format)) {
            throw new Exception('QRCode: function image'.$format.' does not exists.');
        }

        ob_start();
        $success = call_user_func('image'.$format, $this->image);

        if ($success === false) {
            throw new Exception('QRCode: function image'.$format.' failed.');
        }

        $content = ob_get_clean();

        return $content;
    }