-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unshift error when using .execute() command #97
Comments
You will need to refactor to use the updated method of It takes in the command, in your case "convert", then an array of options. For example:
You are still using the old "exec" style, which is to just pass a string. Version 2 deprecated that style of exec, and Version 3 completely removed it. |
Hi @mrkmg - thanks for the quick response. Does this mean that all our parameters need to be individually quoted or can we pass them in together? i.e. thanks |
Hi @mrkmg, ok I finally got it working. I had to provide each option and it's value in quotes separated by commas. That is not intuitive and not described in any examples or obvious from your comment. I think it would help to have a clear example so the next coder doesn't fall into the same pit of guessing like I did. This small test script worked for me. I hope it helps the next person.
@mrkmg What I don't really understand is why you guys implemented it this way or why even deprecate the old way in the first place. The old way worked just fine. It seems to me sending options should be supported better, perhaps more like an element array. This would have been more intuitive:
or if mapping the options to pass into the command line was too much of a hassle, put all the options into a string, like |
On other point of feedback. I think the |
I completely agree on the documentation. That has always been my weak-point. I will strive to make it better. As for why I deprecated the old method. it was no more than just Another reason for switching from a single string of options to an array of options was to deal with escaping of the options. It can be quite difficult in some cases to get the escaping right when dealing with a complex set of options. This makes it so you do not have to worry so much of escaping. I really dig the idea of passing in params of options in an object form, and actually gm seems to be similar in idea to that (except its procedural instead of parametric). |
Hello,
I recently was trying to update our modules for easyimage in our nodeJS app to the latest and have hit a wall on trying to figure out where the problem lies. We currently are using npm module version 2.1.0 in our application, which has been converting images quite well. I was upgrading (as we do) to 3.0.1 to stay up with the latest and ran into issues when shifting from the deprecated
exec
function changing toexecute
.Around version 2.2.1, we start to see this warning when using the .exec() function.
but when switch to execute() function, it also fails.
When I change the code to
execute
we see anunshift
error. The ends up being caught with our error handler on the returned promise that the execute function returns. I've experimented by changing the parameters that we are passing in, thinking that something changed there, but it doesn't seem to make a difference.Can someone give me a clue as to what I might be doing wrong or is this a bug? I've pasted error, environment and code below.
node 7.10.1
I am running Ubuntu on WSL (Windows)
I have this version of ImageMagick installed
The text was updated successfully, but these errors were encountered: