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 - npm Package Compare versions

Comparing version 2.2.1 to 2.2.2

8

index.js

@@ -55,5 +55,5 @@ var deprecate = require('util').deprecate;

if (y > x) {
return [Math.floor(yMax * x / y), yMax];
return [Math.round(yMax * x / y), yMax];
} else {
return [xMax, Math.floor(xMax * y / x)];
return [xMax, Math.round(xMax * y / x)];
}

@@ -63,8 +63,8 @@

// Width given, height automagically selected to preserve aspect ratio.
return [xMax, Math.floor(xMax * y / x)];
return [xMax, Math.round(xMax * y / x)];
} else {
// Height given, width automagically selected to preserve aspect ratio.
return [Math.floor(yMax * x / y), yMax];
return [Math.round(yMax * x / y), yMax];
}
};
{
"name": "aspectratio",
"version": "2.2.1",
"version": "2.2.2",
"description": "Image aspect ratio utility",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -45,2 +45,7 @@ var assert = require('assert');

});
it('properly rounds all edges', function() {
var bounds = aspect.resize(800, 534, 500, 500);
assert.deepEqual(bounds, [ 500, 334 ]);
});
});

@@ -47,0 +52,0 @@ });

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