Type: Function

How to get getImageDataFromUrl?


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.


  1. viewDocumentNode


    Type: HTMLDocument

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

  2. previewUrl


    Type: String

    The URL for the image to load.

  3. asObjectUrl


    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


Type: Promise<ImageData>