Thumb.to()

Transform an convert image (PNG, JPG) with crop, resize, blur, rotate, flip, ...

Base on : https://github.com/mash/node-imagemagick-native. See Test file example (npm test)

Usage

Hover over inputs/exits for more info.

var Thumb = require('machinepack-thumb');


// Transform an convert image (PNG, JPG) with crop, resize, blur, rotate, flip, ...

Thumb.to({

blur: 2,

width: 120,

height: 120,

size: '120x250',

source: 'samples/test.png',

destination: 'samples/test-blur.png',

done: '*',

quality: 2,

}).execSync();

Inputs

blur

a number

2
width

a with of thumb

120
height

a height of thumb

120
size

a string [width]x[height]

'120x250'
source

a source path

'samples/test.png'
destination

a destination path

'samples/test-blur.png'
done

a callback after writing

quality

a number (1-100)

2

Exits

error

An unexpected error occurred.

success

OK.