grunt-gm v0.4.3
Batch process your images with gm.
Getting Started
This plugin requires Grunt ~0.4.0
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-gm --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt;
Overview
At the moment the task is pretty much just a simple grunt
wrapper to gm.
Before start, please verify your GraphicsMagick or ImageMagick installation by running convert -vsersion
.
If the task ran into error Fatal error: Maximum call stack size exceeded
, it's probably because the files array is too long.
To resolve this, try:
- Run
grunt
with custom stack sizenode --stack-size=9999 node_modules/grunt-cli/bin/grunt gm
- Check default by
node --v8-options | grep -B0 -A1 stack_size
If your are on OSX, and the task ended with:
dyld: Library not loaded: /usr/local/lib/libfreetype.6.dylib Referenced from: /usr/local/bin/gm Reason: image not found
try brew unlink freetype && brew link freetype
The Task
See basic usages.
grunt;
Original | After Task #1 | After Task #2 | After Task #3 | After Task #4 |
---|---|---|---|---|
- Options precedence:
- CLI, eg.
--skipExising
- File, eg.
files:[{options:{skipExising:true}}]
- Task, eg.
gm:{task1:{options:{skipExising:true}}
- CLI, eg.
- Task will traverse the file list and execute
gm
tasks one by one, top down - Grunt with
--verbose
flag to print out correspondinggm
argument list
TODO
Release History
- 2014-10-03 v0.4.3 Add js build, update log dump
- 2014-08-11 v0.4.1 Rebuild broken release
- 2014-08-08 v0.4.0 Support function in task argument list
- 2014-07-30 v0.3.0 Support multiple gm tasks
- 2014-07-29 v0.2.1 Reimplement the task
- 2014-07-28 v0.2.0 Add options
skipExisting
andstopOnError
- 2014-07-27 v0.1.2 Temp fix require
- 2014-07-27 v0.1.1 Fix log dump and
mkdir -p dest
if not exists - 2014-07-27 v0.1.0 Initial release