Images

Loby provides a fully functional image generator, that dynamically generates images for requested sizes. The images are quickly generated and cached for fast reuse.

Upload

POST /images

Upload an image. The body is JSON with a data-URL in base64Data.

PropertyTypeDescription
base64DatastringData-URL, for example data:image/png;base64,.... The part before ;base64, must include a MIME type.
Copy
{ "base64Data": "data:image/png;base64,iVBORw0KGgo..." }

Returns { "id": "..." }. Use that id in avatar fields and in the CDN URL below.

If base64Data is missing, the response is 400 with BASE64_DATA_MISSING. If the data-URL is not a valid data:<mime>;base64,<payload> string, the response is 400 with BASE64_DATA_INVALID.

URL Format

Use the following url for generating images:

https://img.loby.io/{{imageId}}_{{sizingType}}{{size}}.{{format}}

ComponentDescriptionExample
imageIdThe id of the image6ef7d631-b898-40a4-ba27-b8c772f6db03
sizingTypeThere are 3 options: w, h and s. By choosing w, image is sized according to width. h according to height and s will square crop the image and size according to both sidesw
sizeThe size according to the sizing type1280
formatYou can choose between jpg and pngjpg

Example

https://img.loby.io/6ef7d631-b898-40a4-ba27-b8c772f6db03_w1280.jpg

Previous
Querying
Next
Customer