Socket
Book a DemoInstallSign in
Socket

resize-png-buffer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

resize-png-buffer

Resize a PNG buffer into square images of different sizes.

latest
Source
npmnpm
Version
1.0.1
Version published
Maintainers
1
Created
Source

resize-png-buffer

Resize a PNG buffer into square images of different sizes.

Usage

var resizePngBuffer = require('resize-png-buffer')
var fs = require('fs')

var resize = resizePngBuffer(fs.readFileSync('image.png'))

resize([96, 96], function (err, buffer) {
  if (err) return next(err)
  fs.writeFile('image-96x96.png', buffer, next)
})

resize = resizePngBuffer(buffer)

Returns a resize function, where buffer is the contents of a PNG file as a Node.js Buffer.

resize(shape, done(err, buffer))

Resizes the image using shape, an array with [width, height] for the output image. Calls done(err, buffer) when complete, where buffer is the contents of the output PNG file as a Node.js Buffer.

License

MIT

Keywords

resize

FAQs

Package last updated on 21 Sep 2017

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