get Image Data From Url
Type: Function
How to get getImageDataFromUrl?
JavaScript
import getImageDataFromUrl from 'fontoxml-image-resolver/src/getImageDataFromUrl.js'
Get the native width, height, and image data (as data url) for an image found at a given URL.
Arguments
view
Document Node (Required)
Type: HTMLDocument
A document node in the browser's DOM, used to create a temporary img element in order to load the image.
preview
Url (Required)
Type: String
The URL for the image to load.
as
Object Url (Required)
Type: Boolean
Whether to use an object URL instead of a data URL. Creating an object URL is faster, but the caller should make sure to call revokeObjectURL to release memory when the image is no longer needed.
Default value
Returns
Type: Promise<ImageData>
Related links
-
Use getImageDataFromImageId to load an image from content using the corresponding asset preview URL.