1.4.0 • Published 1 year ago
html-load-image v1.4.0
HTML Load Image Package
Overview
This package is to get the image files as dataURLs from Event
or DragEvent
. It's using blueimp-load-image package as a dependency.
Install
yarn add html-load-image
Definitions
type getImage = (event: Event, options?: LoadImageOptions) => Promise<string>
type getImages = (event: Event, options?: LoadImagesOptions) => Promise<string[]>
type LoadImageOptions = Omit<BlueImpLoadImageOptions, 'orientation' | 'meta' | 'canvas'>
interface LoadImagesOptions extends LoadImageOptions {
maxLoadImageCount: number
}
Usage
const image = await getImage(event)
const images = await getImages(event, { maxLoadImageCount: 5 })