CROPRO — image cropping and rotation component for your web apps.
CROPRO is a JavaScript browser library for adding image cropping and rotation functionality to
your web applications.
For a more detailed "Getting started" and other docs and tutorials, please refer to the official documentation.
Installation
npm install cropro
or
yarn add cropro
Usage
To add CROPRO to your web application follow these 3 easy steps:
- Create an instance of
cropro.CropArea
by passing a target image reference to the constructor. - Set an event handler for
render
event. - Call the
show()
method.
Here's a simple example:
import * as cropro from 'cropro';
let cropArea = new cropro.CropArea(document.getElementById('myimg'));
cropArea.addRenderEventListener(dataUrl => {
document.getElementById('myimg').src = dataUrl;
});
cropArea.show();
Demos
Check out CROPRO demos here.
More docs and tutorials
CROPRO docs can be found here.
Credits
cropro is using icons from Material Design Icons for its toolbar.
License
Linkware (see LICENSE for details) - the UI displays a small link back to the CROPRO website which should be retained.
Alternative licenses are available through the official website.