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

/hyperresize/

    Package Sidebar

    Install

    npm i hyperresize

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • dominictarr