crop-area-calculator

1.0.1 • Public • Published

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

/crop-area-calculator/

    Package Sidebar

    Install

    npm i crop-area-calculator

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    15 kB

    Total Files

    8

    Last publish

    Collaborators

    • jonathanp