1

I get strange error when I use gm package. I work with Windows x86. Already I installed gm, also imagemagick.

This is my code:

function convert(response, next) {
            console.time("convertImage");
            console.log("Reponse content type : " + response.ContentType);
            console.log("Conversion");

            GM(response.Body, fullName).setFormat('jpeg').antialias(true).density(300).toBuffer(
                function(err, buffer) {
                    if (err) {
                        next(err);
                    } else {
                        console.timeEnd("convertImage");
                        next(null, buffer);
                    }
                });
        }

This is error that I get:

Debug: internal, implementation, error
    Error: Command failed: identify.exe: no decode delegate for this image forma
t `' @ error/constitute.c/ReadImage/501.

    at ChildProcess.proc.on.onExit (d:\node.js\ImageUploaderWorker\node_modules\
gm\lib\command.js:297:17)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:827:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

You can see that imagemagick has jpeg support due to I can't understand what is my problem.

$ convert --version
Version: ImageMagick 6.9.3-8 Q16 x86 2016-04-10 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib cairo freetype jng jp2 jpeg lcms lqr openexr pangoca
iro png ps rsvg tiff webp xml zlib
Rougher
  • 834
  • 5
  • 19
  • 46
  • It looks like you are trying to run `convert` but are in fact running `identify`, so something has gone horribly wrong - maybe incompatible DLLs or versions. I think you'll need to reinstall. – Mark Setchell Apr 22 '16 at 08:00
  • What reinstall? I reinstalled ImageMagick and all npms twice, but it's not working... – Rougher Apr 22 '16 at 13:04
  • What's `fullName` & `response.Body`? – emcconville Apr 22 '16 at 14:05
  • fullName - bucket.key (simple string), response.Body - binary of image. But already doesn't matter, I used 'sharp' npm. Thank you. – Rougher Apr 25 '16 at 04:52

0 Answers0