@solakuroky/image-clipper
v0.0.2
Published
receive a image and return a clipped image
Downloads
2
Maintainers
Readme
image-clipper
image clipper
Screenshot
install
npm install @solakuroky/image-clipper
Usage
var imageClipper = require('@solakuroky/image-clipper')
var clippedImage = imageClipper('https://someimage.png')
<script type="text/javascript">
function cropImage(source) {
var file = source.files[0]
var clippedImage = imageClipper(file, {
callback: callback
})
}
function callback(canvas, resolve, reject) {
resolve(canvas.toDataUrl())
}
</script>
<input type="file" name="file" onchange="cropImage(this)" />
API
image-clipper
options
License
image-clipper is released under the MIT license.