hyperresize

1.0.0 • Public • Published

hypercrop

simple image cropper, good with hyperscript.

var h = require('hyperscript')
var hypercrop = require('hypercrop')
var hyperfile = require('hyperfile')

document.body.appendChild(
  hyperfile.asDataURL(function (src) {
    document.body.appendChild(
      //once the user selects a range, callback with that selection as a dataurl.
      hypercrop(
        h('img', {src: src}),
        //canvas to write selection into (optional) defaults to this size.
        //this does not need to be attached to the dom.
        h('canvas', {width: 512, height: 512}),
        function onCrop (src2) {
        
      })
    )
  })
)

currently only square selections are supported.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i hyperresize

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • dominictarr