0.0.1 • Published 10 years ago

thumbnail-psd v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

thumbnail-psd

thumbnail-psd module for Node.js. generate thumbnial for psd and other images. 生成psd和一些图片格式的缩略图。

Note!

thumbnail-psd depend software imagemagick , so you should install imagemagick. How to install imagemagick? see http://www.imagemagick.org/

Install

npm install thumbnail-psd --save

How to use

  _thumbnail = require('thumbnail-psd')
  _thumbnail(sourceFile, destFile[, options], callback)

options optional

a json object. default: {width: 100, height: 80}

optiosn.width optional

the width of thumbnail . default: 100

options.height

the heigth of thumbnail. default: 80

for example:

  _thumbnail = require('thumbnail-psd');
  _thumbnail('test/a.psd', 'test/a.thumbnail.png', function(err) {
    if (err) {
      console.log(err);
    }else{
      console.log('complete a.psd');
    }
  });
  _thumbnail('test/d.png', 'test/d.thumbnail.png', {width: 400, height: 300}, function(err) {
    if (err) {
      console.log(err);
    }else{
      console.log('complete d.png');
    }
  });

Test

npm test

Support

JPEG, PNG, JPG, GIF, PSD

LICENSE

MIT see https://github.com/huyinghuan/grunt-file2head/blob/master/LICENSE-MIT