Skip to content

hyperhype/hypercrop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Jan 31, 2017
f1393f2 · Jan 31, 2017

History

18 Commits
Jan 27, 2017
Jul 23, 2016
Jul 23, 2016
Jul 24, 2016
Jan 30, 2017
Jan 31, 2017
Jan 31, 2017

Repository files navigation

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

About

Simple image cropper built with hyperscript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published