Uploader Image Object Model
The ImageObject
is an object representation of the image that has been uploaded using the uploader widget.
It contains a variety of useful information about the uploaded image, including the image's size, format, dimensions, URL, and more.
The ImageObject
is usually returned with React Uploader when responseType=object
, or via EventListener
when used with HTML integration.
The model includes the following structure:
export interface ImageObject {
blurHash: string;
colors: {
count: number;
hex: string;
name: string;
type: string;
}[];
contentLength: number;
contentType: string;
createdAt: number;
extension: string;
height: number;
id: string;
putAt: number;
updatedAt: number;
version: number;
width: number;
url: string;
}
Let's take a closer look at each of these properties:
blurHash
: This is the image's blurHash, which is a compact representation of the image's appearance. BlurHash can be used to quickly load a low-quality version of the image while the high-quality version is being loaded.colors
: This property contains an array of objects that represent the dominant colors in the image. Each object contains a count, hex, name, and type property.contentLength
: This is the length of the image's content in bytes.contentType
: This is the MIME type of the image.createdAt
: This is the timestamp of when the image was first uploaded.extension
: This is the file extension of the image.height
: This is the height of the image in pixels.id
: This is the unique ID of the image.putAt
: This is the timestamp of when the image was last uploaded or modified.updatedAt
: This is the timestamp of when the image was last updated.version
: This is the version number of the image.width
: This is the width of the image in pixels.url
: This is the URL of the image that can be used to display or download the image.
By using the ImageObject
, developers can easily access and use the uploaded image's information in their web applications.