node-imagemagick-native
node-imagemagick-native copied to clipboard
imagemagick.identify throws Segmentation fault: 11
var photoData = fs.readFileSync(photoPath); var identify = imagemagick.identify({ srcData: photoData, debug: 1 });
mac:scripts me$ node footer.js composite photo photos/DSC_8634.jpg debug: on original width,height: 1477, 1920 Segmentation fault: 11
mac:scripts me$ brew info imagemagick imagemagick: stable 6.9.0-9 (bottled), HEAD
mac:scripts me$ uname -a Darwin mac.local 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64 mac:scripts me$ sw_vers -productVersion 10.10.3
You should post the picture somewhere to make debugging at least possible. :)
I have the same issue, stats are:
Node v4.2.1 ImageMagick v6.8.7-10 OSX v10.11
The image I am using is https://www.google.co.uk/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png but I am having the same issue with any image.
I have created a simple script that outlines the problem:
var im = require('imagemagick-native'),
fs = require('fs');
var image = "/tmp/googlelogo_color_272x92dp.png";
im.identify({srcData: fs.readFileSync(image), debug: true}, function(err, res) {
if (err) {
console.log(err);
process.exit();
}
console.log(res);
process.exit();
})
The debug indicates that it is getting to the point of accessing imagemagick but then failing. Output is as follows:
debug: on
ignoreWarnings: 0
original width,height: 544, 184
Segmentation fault: 11
I am able to identify the image via the command line fine:
/tmp/googlelogo_color_272x92dp.png PNG 544x184 544x184+0+0 8-bit sRGB 13.5KB 0.000u 0:00.000
Any help on this would be greatly appreciated.
Same problem here.
OSX v10.11.1 ImageMagick v6.9.2-5 NodeJS v0.10.36 imagemagick-native v1.8.0
Having a similar problem with latest versions -
OSX - v10.11.2
ImageMagick - v6.9.2-10
NodeJS - v5.4.0
(also tried with v5.0.0
& v4.2.3
)
imagemagick-native - elad/node-imagemagick-native.git#travis-4.1
(to avoid NaN errors)
Some more info -
- It runs through command line when I call identify command on an image but fails through code (i.e. imagemagick-native).
- Through code if I create & pass buffer object
new Buffer([1,2,3,4])
it works but if I read image withfs.readFileSync
in buffer identify fails.
Same problem here as OP.
Is someone found a solution for this? Node - 4.2.4