3

I am trying to create a thumbnail with an image that I have already saved. I am using the module gm to adjust the size of the image.

var gm = require ('gm');
var fs = require('fs');
var savedphoto = "./testphoto.jpeg";
var testdir = "./testoutput.jpeg";
gm(savedphoto)
    .resize(100, 100)
    .noProfile()
    .write(testdir, function (err) {
        console.error (err);
    });

When I run this I get the error spawn ENOENT.

code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn. 

How would I fix this problem?

2 Answers2

7

Replace:

var gm = require('gm');

for

var gm = require('gm').subClass({ imageMagick: true });
DadoCe
  • 329
  • 3
  • 6
  • This solution worked for me. By default, gm expects to use the graphicsmagick library instead of imagemagick. In my case, changing folder permissions had no effect. – RevNoah Sep 11 '14 at 17:32
0

Recipe for MacPorts users only (based on @RevNoah notice):

sudo port install GraphicsMagick

It will install GraphicsMagick library.

zoonman
  • 1,116
  • 1
  • 12
  • 30