thumbs
Transform stream which reads files, creates thumbnails of them, and writes their filenames.
Example
var thumbs = ; var thumbnails = ; thumbnails; thumbnails;
Methods
var thumbs = require('thumbs')(formats);
Return a transform stream which reads {src: '', dest: ''}
objects and writes
{src: '', dest: ''}
objects based on the given formats
.
formats
is an object where each key is used in the written dest
name
and each value can use the following opts
:
width
- pixel width of the thumbnail or relative toheight
if undefinedheight
- pixel height of the thumbnail or relative towidth
if undefinedmax
- pixel width or height of the thumbnail depending on which dimension is largestquality
- compression quality of the thumbnail (from0
to100
)
Installation
Install imagemagick
with your platform's native package manager:
apt-get install imagemagick
brew install imagemagick
pacman -S imagemagick
Install the NPM module:
npm install thumbs
License
MIT