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

img-convert

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

img-convert

Converts images using ImageMagick CLI

latest
Source
npmnpm
Version
1.1.2
Version published
Maintainers
1
Created
Source

img-convert

Simple crossplatform converter for images.

Requires ImageMagick installed and added to PATH.

Install

npm install img-convert --save

Syntax

require('img-convert')(imgPath, targetPath[, params])
  • imgPath <string> path to image file for conversion

  • targetPath <string> path to converted image file

  • params <object> contains execution parameters

Returns Promise which fulfills to targetPath.

Optionally you can specify the path for ImageMagick binary:

require('img-convert').path = "path/to/converter"

Usage

const imgConvert = require('img-convert')
imgConvert('~/picture.png', '~/thumbs/small_picture.gif', { resample: 96, resize: '50%' })
  .then(targetPath => {
    console.log(targetPath)  // '/mnt/d/thumbs/small_picture.gif'
  })
  .catch(console.log.bind(console))

Keywords

imagemagick

FAQs

Package last updated on 13 May 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