New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

aspectratio

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aspectratio

Image aspect ratio utility

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
710
decreased by-21.37%
Maintainers
1
Weekly downloads
 
Created
Source

aspectratio

Build status NPM downloads NPM version Node version Dependency status

Image aspect ratio utilities.

Join the chat at https://gitter.im/Turistforeningen/node-s3-uploader

Install

npm install aspectratio --save

API

var aspect = require('aspectratio');

fixed(integer height, integer width, string ratio)

Apply a fixed aspect ratio without distoring the image.

  • integer height - original image height
  • integer width - original image width
  • string ratio - new image ratio

This will return an Array of four values:

  1. integer x - top lef x coordinate
  2. integer y - top lef y coordinate
  3. integer width - new image width
  4. integer height - new image height
Example

Cropp with fixed ratio

var crop = aspect.fixed(2048, 768, '4:3');
// [512, 768, 1024, 768]

MIT License

Keywords

FAQs

Package last updated on 10 Apr 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc