Skip to content

Example of working with GraphicsMagick (or ImageMagick) in Node.js

License

Notifications You must be signed in to change notification settings

GonzaloGM/carpoolear-trip-images

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Carpoolear Trip Images

A Node.js example of working with GraphicsMagick (or ImageMagick) to generate a list of images with data loaded from a JSON file (an external API for example).

It also includes a static page that triggers the image generation and then asynchronously loads it with AJAX (with a retryer in case the image takes too long to generate).

Originally created for Carpoolear, a free carpooling app created by STS Rosario, an NGO from Rosario, Argentina.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Installing

GhostScript

You will need to download and install Ghostscript and you have to install GraphicsMagick binaries. Here's the GraphicsMagick Windows binaries.

Then, install the GraphicsMagick package globally, and afterwards, install the project dependencies:

npm install -g gm
npm install

NOTE: after installing GhostScript you may need to reinstall GraphicsMagick if you already had installed it.

Common Issues with Ghostscript

If you get this error:

Command failed: gm convert: Unable to read font (n019003l.pfb) [No such file or directory].

you can try going to your Ghostscript installation folder (i.e., C:\Program Files\gs\gs9.20), and adding this fonts folder.

Running

nodemon npm start

And open the following URL on your browser: http://localhost:3000/

Deployment

Heroku

Heroku needs a little tweaking to work with GraphicsMagick, you'll need to add a buildpack. Click the following link to use GraphicsMagick in Heroku.

ImageMagick

If you need to, here's how to use ImageMagick with gm on Node.js.

Built With

  • Express - The framework used
  • gm - GraphicsMagick (or ImageMagick) for Node.js

Authors

  • Gonzalo González Mora - Initial work - GonzaloGM

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

About

Example of working with GraphicsMagick (or ImageMagick) in Node.js

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published