powered by
Reads an image file from the given path and encodes it as a base64 string. Used internally for Gemini API image upload.
read_image(img_path)
Base64-encoded string of the image, or NULL if the file does not exist.
Path to the image file.
if (FALSE) { base64_img <- read_image("cat.png") }
Run the code above in your browser using DataLab