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

graphicsmagick-stream

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

graphicsmagick-stream

Fast convertion/scaling of images using a pool of long lived graphicsmagick processes

1.0.0
Source
npm
Version published
Weekly downloads
3
-50%
Maintainers
1
Weekly downloads
 
Created
Source

graphicsmagick-stream

Fast convertion/scaling of images using a pool of long lived graphicsmagick processes

npm install graphicsmagick-stream

It works by spawning and reusing a custom graphicsmagick processes (see src/) that accepts images over stdin and pipes out the converted result over stdout

Usage

var gm = require('graphicsmagick-stream')
var fs = require('fs')

var convert = gm({
  pool: 5,        // how many graphicsmagick processes to use
  format: 'png',  // format to convert to
  scale: {
    width: 200,   // scale input to this width
    height: 200,  // scale input this height
    ratio: true   // keep the aspect ratio (defaults to true)
  },
  crop: {
    width: 200,   // crop input to this width
    height: 200,  // crop input this height
    x: 0,         // crop using this x offset
    y: 0          // crop using this y offset
  },
  rotate: 'auto'  // auto rotate image based on exif data
                  // or use rotate:degrees
})


fs.createReadStream('input.jpg')
  .pipe(convert({
    // override any of the above options here
  }))
  .pipe(fs.createWriteStream('output.jpg'))

Dependencies

You need to install libgraphicsmagicks in order to compile this On OSX using homebrew you can do

brew install graphicsmagick --build-from-source

License

MIT

Keywords

gm

FAQs

Package last updated on 26 Jun 2014

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