createImageTypeRegExp( types ) → RegExp
Creates a regular expression used to test for image files.
const imageType = createImageTypeRegExp( [ 'png', 'jpeg', 'svg+xml', 'vnd.microsoft.icon' ] ); console.log( 'is supported image', imageType.test( file.type ) );
types : Array.<String>
fetchLocalImage( image ) → Promise.<File>
Creates a promise that fetches the image local source (Base64 or blob) and resolves with a
image : Element
Image whose source to fetch.
A promise which resolves when an image source is fetched and converted to a
Fileinstance. It resolves with a
Fileobject. If there were any errors during file processing, the promise will be rejected.
isLocalImage( imageUtils, node ) → Boolean