Skip to contents

Read image file and encode it to base64

Usage

image_encode_base64(image_path)

Arguments

image_path

The path to the image file.

Value

A base64 encoded string.

Examples

image_path <- file.path(system.file("extdata", package = "ollamar"), "image1.png")
substr(image_encode_base64(image_path), 1, 5) # truncate output
#> [1] "iVBOR"