Skip to content

Commit

Permalink
Adds polygonal selection feature.
Browse files Browse the repository at this point in the history
- Updates all current features (drag and drop files, select cropping
area, generate base64) to work with polygonal selections.
- Removes moving function, it's not needed in the polygonal selection.
- Updates README.md.
- Updates npm version.
- Fixes #5.
  • Loading branch information
brizental committed Dec 4, 2017
1 parent 0cc9bce commit 4dd0150
Show file tree
Hide file tree
Showing 6 changed files with 325 additions and 508 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Embed for cropping images and returning a base64 of the cropped area.
Image cropper utility that crops an image in any polygonal shape chosen and returns a base64 of the cropped area.

### Usage

Expand All @@ -15,9 +15,16 @@ $ npm install idcrop
```js
const idcrop = require('idcrop')

idcrop.init('toolbarContainer', 'displayContainer', 'previewContainer')
idcrop.init('toolbarContainer', 'displayContainer', 'previewContainer', 4)
```

The paramenters for the `init` function are, in order:

- The id of the container you want the toolbar to render at.
- The id of the container you want the display to render at.
- The id of the container you want the preview to render at.
- The number of sides you want the cropping polygon to have.

###### HTML

You must create a container for display (cropping area), toolbar (for now, only
Expand Down
Loading

0 comments on commit 4dd0150

Please sign in to comment.