image-handler
v0.0.7
Published
A project extend handler of image on H5
Downloads
5
Maintainers
Readme
Installation
npm i image-handler
Usage
compressImage(OBJECT)
import imgHandler from 'image-handler'
imgHandler.compressImage(file, quality, maxSize)
Params descript
Callback description
return a Promise Object
<Promise>.then((file) => {
// file: after compressing file object
})
fileToUrl(OBJECT)
import imgHandler from 'image-handler'
imgHandler.fileToUrl(file)
Params descript
Callback description
return a local file url
// example: blob:null/34fd9c5a-fe01-4811-8154-e91858e323c9
<img src="blob:null/34fd9c5a-fe01-4811-8154-e91858e323c9">