New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

resize-image-buffer

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resize-image-buffer

Resize image buffer in memory

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1.2K
-7.69%
Maintainers
1
Weekly downloads
 
Created
Source

Resize images in memory

Install

npm install resize-image-buffer

yarn add resize-image-buffer

Usage

const fs = require('fs');
const resizeImg = require('resize-image-buffer');

(async () => {
  const image = await resizeImg(fs.readFileSync('unicorn.png'), {
    width: 128,
    height: 128,
  });

  fs.writeFileSync('unicorn-128x128.png', image);
})();

API

resizeImg(buffer, options)

Returns a Promise<Buffer> with the resized image.

buffer

Type: Buffer

An image buffer. Supported formats are bmp, jpg and png.

options

Type: Object

width

Type: number

Desired width of the target image.

height

Type: number

Desired height of the target image.

format

Type: string

The output file format for the target image. Supported formats are bmp, jpg and png.

Keywords

fast

FAQs

Package last updated on 28 Jul 2020

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