Module: utils/magick

Wrapper around gm (ImageMagick) API's selected parts.

gm's API is two-fold: getters like size, identify… are one-shot calls, whereas other functions are chainable calls whose purpose is to build a convert command's options sequence; that chain ends up with a call to write.

Both getters and write use the error-first callback style. The goal of this wrapper is to provide a promise-compliant API, as well as exposing utility functions.

Source:
See:

Classes

Magick

Methods

(inner) buildPromiseAPI()

Extend a Magick instance with a promise-compliant API.

Source:

(inner) clamp(value, min, max)

Cap a number to a range.

Parameters:
Name Type Description
value Number

A number to be limited to the output range

min Number

The lower boundary of the output range

max Number

The upper boundary of the output range

Source:
Returns:

A number in the range [min, max]