Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 19, 2024 via pnpm

gm 1.25.0

GraphicsMagick and ImageMagick for node.js
Package summary
Share
0
issues
2
licenses
6
MIT
5
ISC
Package created
29 Apr 2011
Version published
21 Sep 2022
Maintainers
1
Total deps
11
Direct deps
4
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
6 Packages, Including:
array-parallel@0.1.3
array-series@0.1.5
cross-spawn@4.0.2
debug@3.2.7
gm@1.25.0
ms@2.1.3

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
5 Packages, Including:
isexe@2.0.0
lru-cache@4.1.5
pseudomap@1.0.2
which@1.3.1
yallist@2.1.2
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

4
All Dependencies CSV
β“˜ This is a list of gm 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
array-parallel0.1.32.45 kBMIT
prod
array-series0.1.52.43 kBMIT
prod
cross-spawn4.0.24.99 kBMIT
prod
debug3.2.716.48 kBMIT
prod

Visualizations

Frequently Asked Questions

What does gm do?

gm is a package available on NPM, primarily designed to provide Node.js bindings for ImageMagick and GraphicsMagick. Graphicsmagick and ImageMagick are recognized tools in image processing, both of which allow for complex manipulation, conversion and analysis of images in various formats. The package empowers developers with the ability to perform wide range of image operations such as resizing, cropping, annotating images among many others, right within their Node.js applications.

How do you use gm?

To use gm, first, you need to download and install either GraphicsMagick or ImageMagick. After successful installation of either ImageMagick or GraphicsMagick, you can then proceed to install gm using npm:

npm install gm

Next, you can start using the gm package in your JavaScript code as illustrated:

const gm = require('gm');

//resize and remove EXIF profile data
gm('/path/to/my/img.jpg')
.resize(240, 240)
.noProfile()
.write('/path/to/resize.png', function (err) {
  if (!err) console.log('done');
});
//note replace '/path/to/my/img.jpg' with the path to the image
//you want to process and '/path/to/resize.png' with the path
//to where you want to save the processed image

In addition to basic usage, gm also supports stream operations:

var readStream = fs.createReadStream('/path/to/my/img.jpg');
gm(readStream, 'img.jpg')
.write('/path/to/reformat.png', function (err) {
  if (!err) console.log('done');
});

You can refer to the examples given in the readme for more usage scenarios involving gm.

Where are the gm docs?

The official gm documentation is available here. This documentation provides a comprehensive guide on the usage of the package – from the basic setup to utilizing advanced features. The documentation is well-structured, offering an exhaustive list of features which the library supports, and the corresponding methods to utilize these features. The gm Github repository is also an invaluable resource with several examples and further usage explanations.