0.0.1 • Published 9 years ago

native-thumber v0.0.1

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

native-thumber

Node module : Very fast resize / crop Image with Native ImageMagick Librairy in coffee for node.js

Build Status

You need :

sudo apt-get install libmagick++-dev

Installation

npm install native-thumber

USECASE

uploadService = require 'native-thumber'


config =
  store: 'locale'
  directory: 'upload/'
  schemas: [
    {version: 'thumb', size: '50x50', quality: 75},
    {version: 'box', size: '380x380'}
  ]

uploader = new uploadService(config)

uploader.process path, filename, size, () ->
  console.log "Successfully"

or another config

config =
  store: 's3'
  s3Path:'./config/s3.json'
  bucket: 'bucketname'
  directory: 'upload/'
  quality: 80
  resizeStyle: 'aspectfill'
  gravity: 'Center'
  ifOriginal: false
  schemas: [
    {version: 'thumb', size: '50x50', quality: 75},
    {version: 'box', size: '380x380', blur: 5, flip: true}
  ]

uploader = new uploadService(config)

uploader.process item.fd, filename, item.size, () ->
  console.log "Successfully"