Socket
Socket
Sign inDemoInstall

crop-area-calculator

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    crop-area-calculator

Utility function for calculating coordinates for image cropping


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Install size
14.7 kB
Created
Weekly downloads
 

Readme

Source

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

FAQs

Last updated on 29 Jul 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc