Socket
Socket
Sign inDemoInstall

@jimp/plugin-resize

Package Overview
Dependencies
Maintainers
2
Versions
240
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jimp/plugin-resize - npm Package Compare versions

Comparing version 0.5.0 to 0.5.1

8

package.json
{
"name": "@jimp/plugin-resize",
"version": "0.5.0",
"version": "0.5.1",
"description": "Resize an image.",

@@ -29,4 +29,4 @@ "main": "dist/index.js",

"devDependencies": {
"@jimp/custom": "^0.5.0",
"@jimp/test-utils": "^0.5.0"
"@jimp/custom": "^0.5.1",
"@jimp/test-utils": "^0.5.1"
},

@@ -36,3 +36,3 @@ "publishConfig": {

},
"gitHead": "fbbe0b7da5a9dcf8da35e2dfb2e8265ca850435c"
"gitHead": "b23ab92550336eed5d4ac422564c7c63ea280c73"
}

@@ -28,1 +28,30 @@ <div align="center">

```
## Auto
`Jimp.AUTO` can be passes to either the height or width and jimp will scale the image accordingly. `Jimp.AUTO` cannot be both height and width.
```js
// resize the height to 250 and scale the width accordingly
image.resize(Jimp.AUTO, 250);
// resize the width to 250 and scale the height accordingly
image.resize(250, Jimp.AUTO);
```
### Resize modes
The default resizing algorithm uses a bilinear method.
Optionally, the following constants can be passed to choose a particular resizing algorithm:
```js
Jimp.RESIZE_NEAREST_NEIGHBOR;
Jimp.RESIZE_BILINEAR;
Jimp.RESIZE_BICUBIC;
Jimp.RESIZE_HERMITE;
Jimp.RESIZE_BEZIER;
```
```js
image.resize(250, 250, Jimp.RESIZE_BEZIER);
```
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