Class ImageData
Index
Constructors
Methods
Methods
StaticgetDimensions
- getDimensions(
urls:
| string
| { url?: string }
| Iterable<string | { url?: string }, any, any>,
options?: { accessor?: string; warn?: boolean },
): Promise<
{
fulfilled: { height: number; url: string; width: number }[];
rejected: { url: string }[];
},
>Loads given URLs into image elements returning those that resolved with width & height dimensions. This is useful when the size of an image is necessary before usage.
Parameters
- urls: string | { url?: string } | Iterable<string | { url?: string }, any, any>
A list of image URLS to load or object with an
urlproperty. Optionaloptions: { accessor?: string; warn?: boolean }Optional options.
Optionalaccessor?: stringAccessor string to access child attribute when
urlsentry contains objects.Optionalwarn?: booleanLog debug warnings when a target URL can not be determined; default: false.
Returns Promise<
{
fulfilled: { height: number; url: string; width: number }[];
rejected: { url: string }[];
},
>An object with
fulfilledandrejectedrequests. - urls: string | { url?: string } | Iterable<string | { url?: string }, any, any>
Provides utility functions for retrieving data about images.