0.0.1 • Published 3 years ago

node-poster-gm v0.0.1

Weekly downloads
12
License
-
Repository
-
Last release
3 years ago

前端node工具集

Getting started

First download and install GraphicsMagick or ImageMagick. In Mac OS X, you can simply use Homebrew and do:

brew install imagemagick
brew install graphicsmagick

If you want WebP support with ImageMagick, you must add the WebP option:

brew install imagemagick --with-webp

then either use npm:

npm install gm

useing

const Poster = require('node-poster-browser')

let poster
async function getPoster() {
	if(!poster) {
		poster = await Poster({
      CACHE_DIR: './cache2/'
    })
	}
	return poster
}

async function main() {
  let p = await getPoster()
  p.createPoster()
}
main()

Use ImageMagick instead of gm

Subclass gm to enable ImageMagick

var fs = require('fs')
  , gm = require('gm').subClass({imageMagick: true});

// resize and remove EXIF profile data
gm('/path/to/my/img.jpg')
.resize(240, 240)
...