Skip to content
This repository has been archived by the owner on Feb 25, 2025. It is now read-only.

Invalid parameter error by ImageMagick instead of gm #682

Closed
spursy opened this issue Sep 15, 2017 · 3 comments
Closed

Invalid parameter error by ImageMagick instead of gm #682

spursy opened this issue Sep 15, 2017 · 3 comments

Comments

@spursy
Copy link

spursy commented Sep 15, 2017

When I use ImageMagick by ImageMagick instead of gm, I encounter the the followed issues.

My machine environment is windows, I have insatll imagemagick.exe in my PC.
My node is V8.5.0

{ Error: Command failed: Invalid Parameter - D:\picScrop\myapp\public\images

    at ChildProcess.onExit (D:\picScrop\myapp\node_modules\gm\lib\command.js:301
:17)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at ChildProcess.cp.emit (D:\picScrop\myapp\node_modules\gm\node_modules\cros
s-spawn\lib\enoent.js:40:29)
    at maybeClose (internal/child_process.js:927:16)
    at Socket.stream.socket.on (internal/child_process.js:348:11)
    at emitOne (events.js:115:13)
    at Socket.emit (events.js:210:7)
    at Pipe._handle.close [as _onclose] (net.js:545:12) code: 4, signal: null }

The followed is my code

     var gm = require('gm').subClass({imageMagick: true});

    const imagePath = path.join(__dirname, '../views/pic/sago.jpg');
    const resultPath = path.join(__dirname, '../public/images');
    gm(imagePath)
       /* .resize()
        .autoOrient()*/
        .write(resultPath, function(err, result) {
            if (err) {
                console.log(err);
                res.send('2' + err);
            } else {
                console.log(JSON.stringify(result));
                res.send('123'+ result);
            }
        });
@iCrawl
Copy link

iCrawl commented Sep 17, 2017

#652 , you need to install version 6.

@spursy
Copy link
Author

spursy commented Sep 18, 2017

@iCrawl , I have update nodejs version as 6.11.3. But I still encounter the same exception.

@aheckmann
Copy link
Owner

Fixed by #846. Released in v1.25.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants