util

util / Data2Base64 / 0.1.0

README.md

Introduction

This is an algorithm that takes in http(s), data links or binary data, and returns the base64 representation of the image file.

Input:

  • (Required): Image Input.

Output:

  • Base64 representation of the given image file.

Note: An API result can be at most 10 MB. Any base64 encoded string bigger than 10 MB will not return any result.

Examples

Example 1.

  • Parameter 1: Http link.
"https://s3.amazonaws.com/algorithmia-assets/algo_desc_images/util_Data2Base64/President_Barack_Obama.jpg"

Output:

"/9j/4QaKRXhpZgAASUkqAAgAAAAMAA...aYpV1rwPyy\no82b/9k=\n"

Example 2.

  • Parameter 1. Data API link.
"data://util/Data2Base64/President_Barack_Obama.jpg"

Output:

"/9j/4QaKRXhpZgAASUkqAAgAAAAMAA...aYpV1rwPyy\no82b/9k=\n"

Example 3.

  • Parameter 1. Dropbox link.
"dropbox://images/President_Barack_Obama.jpg"

Output:

"/9j/4QaKRXhpZgAASUkqAAgAAAAMAA...aYpV1rwPyy\no82b/9k=\n"

Example 4.

  • Parameter 1. S3 link.
"s3://bucket-name/images/President_Barack_Obama.jpg"

Output:

"/9j/4QaKRXhpZgAASUkqAAgAAAAMAA...aYpV1rwPyy\no82b/9k=\n"

Credits

Example image was retrieved from: https://en.wikipedia.org/wiki/Barack_Obama#/media/File:President_Barack_Obama.jpg