1.0.1 • Published 5 years ago

crop-area-calculator v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

Crop area calculator

Build Status NPM version

Given a focal point, an aspect ratio and source image dimensions this module will calculate a crop starting point (x1, y1) and end point (x2, y2).

These values can be used for fixed coordinates cropping with tools like e.g. ImageMagick/GraphicsMagick or a service like Cloudinary.

This algorithm has been implemented in the EPiFocalPoint plugin for EpiServer.

Demo

Check out this link or demo.html for an example use case.

How to use

Either npm install --save crop-area-calculator and import it in your own code or go the old school route and download the script file from the dist folder and include it in your page with a <script> tag.

License

MIT © Jonathan Persson

1.0.1

5 years ago

1.0.0

9 years ago