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

cronshot-imagemagick

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

cronshot-imagemagick

Cronshot middleware to manipulate and save images with ImageMagick via gm

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cronshot-imagemagick

CronShot middleware to manipulate and save images with ImageMagick via gm

npm install cronshot-imagemagick

How

CronShot uses:

  • gm

Setup

Install CronShot

npm install cronshot

Install ImageMagick

brew update && brew install imagemagick

Example

var cronshot = require('cronshot'),
  middleware = {
    'imagemagick': require('cronshot-imagemagick')
  };

// Image Magick Example
// --------------------

// Takes a screenshot of sports.yahoo.com,
// and converts the screenshot to be a transparent image using Image Magick

// Image Magick example
cronshot.startCapturing({
  // The webpage URL that you would like to take a screenshot of
  'url': 'http://sports.yahoo.com',
  // The local path where you would like to save the image
  'path': __dirname,
  // Only takes one screenshot
  'cronPattern': false,
  // What middleware functions to use each time a screenshot is taken
  'saveMiddleware': [{
    // Function that does all the Image Magick stuff
    'middleware': middleware.imagemagick,
    'options': {
      'gmCommands': [{
        'method': 'trim',
        'args': []
      }, {
        'method': 'transparent',
        'args': ['#FFFFFF']
      }]
    }
  }]
}, function(err) {
  // optional callback function once all screenshots have been taken
});

Options

Note: All methods supported by gm can be used

{
  // The path where the screenshot will be saved
  'path': '',
  // The image name used to save the screenshot
  'imageName': '',
  // The ImageMagick methods that you would like to be used via the gm node module
  'gmCommands': []
}

Contributing

Please send all PR's to the dev branch.

If your PR is a code change:

  1. Install all node.js dev dependencies: npm install
  2. Update the appropriate module inside of the src/modules directory.
  3. Add a unit test inside of tests/unit/cronshot-imagemagick.js.
  4. Verify that all tests are passing by running npm test.
  5. Send the PR!

Credits

CronShot-ImageMagick would not have been possible without the help/inspiration of the following libraries/awesome people:

  • GraphicsMagick for node
  • Copyright (c) Aaron Heckmann, 2010 - MIT License

Contributors

Keywords

FAQs

Package last updated on 23 Dec 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

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