getImageDataFromImageId

Type: Function

How to get getImageDataFromImageId?

JavaScript

import getImageDataFromImageId from 'fontoxml-image-resolver/src/getImageDataFromImageId.js'

Get the native width, height, and image data (as data url) for an image with the given ID.

For images referenced using a permanent reference ID, first use ReferencesManager#retrieve or ReferencesManager#retrieveSingle to obtain the corresponding image ID.

Arguments

  1. viewDocumentNode

    (Required)

    Type: HTMLDocument

    A document node in the browser's DOM, used to create a temporary img element in order to load the image.

  2. imageRemoteId

    (Required)

    Type: AssetId

    The remote ID of the image.

  3. referrerRemoteDocumentId

    (Required)

    The remote document ID of the document containing the image.

  4. variant

    (Required)

    Type: String

    The variant of the image to retrieve, see the documentation for the asset/preview endpoint for details.

Returns

Type: Promise<ImageData>