Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
imagemagick-convert
Advanced tools
Node.js wrapper for ImageMagick CLI for simple converting images.
With NPM:
npm install --save imagemagick-convert
With Yarn:
yarn add imagemagick-convert
ImageMagick installation (see more details):
OS | Command |
---|---|
OS X | brew install imagemagick |
Ubuntu/Debian | apt-get install imagemagick |
Centos/RHEL | yum install ImageMagick |
Alpine | apk add --update imagemagick |
import {readFileSync} from 'fs';
import {convert} from 'imagemagick-convert';
// somewhere in async function
const imgBuffer = await convert({
srcData: readFileSync('./origin.jpg'),
srcFormat: 'JPEG',
width: 100,
height: 100,
resize: 'crop',
format: 'PNG'
});
Original JPEG:
Converted to PNG and resized:
fit | fill | crop |
---|---|---|
convert(options: Object):Promise<Buffer>
- converts images
Options:
Attribute | Type | Required | Default | Description |
---|---|---|---|---|
srcData | Buffer | * | source image | |
srcFormat | Dictionary | auto-detection | source file format (explicit specification), for more details see ImageMagick Supported Image Formats | |
width | Integer | source width | output image width in pixels | |
height | Integer | source height | output image height in pixels | |
resize | Enum | crop | style of resizing: crop , fit , fill | |
density | Integer | 600 | density/resolution for rendering an image from vector formats such as Postscript , PDF , WMF , SVG | |
background | String | none | background color or transparency for images | |
gravity | Dictionary | Center | gravity option, for more details see ImageMagick gravity options | |
format | Dictionary | source format | output file format, for more details see ImageMagick Supported Image Formats | |
quality | Integer | 75 | JPEG/MIFF/PNG compression level: 1 - 100 | |
blur | Float | 0 | blur level: 0 - 1 | |
rotate | Integer | 0 | rotating degrees | |
flip | Boolean | false | vertical flip |
FAQs
ImageMagick binding over convert functionality
We found that imagemagick-convert demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.