scalableminds / gulp-gm

Image manipulation with gm
MIT License
25 stars 8 forks source link

Unhandled error events #2

Closed haydenbleasel closed 10 years ago

haydenbleasel commented 10 years ago

These are actually errors with gulp-image-resize, however I believe the actual problem lies with gulp-gm (and I can't open issues on a forked repository anyway). While running the gulp-image-resize task on this Gulpfile, the following error is thrown:

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Error: Command failed: gm identify: Unable to open file (/var/folders/5x/c9v30y2j6rgcgk4_yrgs0cmr0000gn/T/gmobNGSn) [No such file or directory].
gm identify: Request did not return an image.

If I change the configuration from imageResize({ width: 992, upscale: false }) to imageResize({ width: 992, upscale: false, imageMagick: true }), a different error appears:

events.js:72
        throw er; // Unhandled 'error' event
              ^
[gulp] Error in plugin 'gulp-gm': Error: Command failed: identify: no decode delegate for this image format `/var/tmp/magick-83641LOdDb6Ct09ff' @ error/constitute.c/ReadImage/501.

Note: ImageMagick and GraphicsMagick are installed through Brew. Thanks!

normanrz commented 10 years ago

Thanks for reporting! I would suspect that this might be an issue with the specific image your are dealing with. Could you provide the source for the whole task and maybe even share a sample image?

haydenbleasel commented 10 years ago

No worries! The source is here, unfortunately it's a little complex but a quick search for imageResize should show where it's used. As for the images, they're all here but I suppose if any image was to cause the error it'd be this one (being the biggest).

haydenbleasel commented 10 years ago

Actually I just found out what it was. gulp.spritesmith was creating an empty image file as it had no valid source files and gulp-gm was exploding because of it. You were correct :) Sorry about that, and thanks for your help!

normanrz commented 10 years ago

Glad I could help :-)