Links
Comment on page

Image Handling

The use of images as a visual representation of information is crucial in many software applications. Our SDK provides the tools and functionality needed to easily handle images. In this section, we will introduce you to image handling in Amity, including how to upload and retrieve images in the SDK.

Image Data

Property
Description
fileId
Identifier for the uploaded file
fileUrl
The HTTP web URL for the uploaded file. You can use this fileUrl for downloading the image file.
attributes
Contains a dictionary with values for name, extension, size & mimeType
of uploaded image
metadata
Contains additional metadata dictionary related to uploaded image such as height, width, isFullImage etc.

Upload Images

To upload an image to the system, you can use the Amity Image Upload API provided by the SDK. The API allows you to upload an image to the Amity server/ The SDK simplifies the process of uploading images by providing pre-built components that you can easily integrate into your application.
iOS
Android
JavaScript
TypeScript
Flutter
Supported ✅ (please wait while we prepare a real example!)
Supported image formats are JPG, PNG and cannot exceed 1GB in size.

Retrieve Images

You can retrieve an image from Amity using the Amity Image Retrieval API provided by the SDK. The API enables you to retrieve an image from the Amity server by supplying the image URL. Once an image is uploaded to the server, the image will be automatically transformed into four different sizes for versatile usage. We provided an option to retrieve a specific image size which are:
  • Small: is used for image thumbnails, with a maximum image size of 160 pixels per dimension. For example, this should be used for small previews in an image gallery that displays a large number of images in a grid.
  • Medium: is used for standard image display, with a maximum image size of 600 pixels per dimension.
  • Large: is used for full-screen image display, with a maximum image size of 1500 pixels per dimension.
iOS
Android
JavaScript
TypeScript
Flutter
Supported ✅ (please wait while we prepare a real example!)
Supported ✅ (please wait while we prepare a real example!)
Last modified 3mo ago