Skip to content
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

System.cmd should call magick mogrify instead of mogrify #85

Closed
Ziinc opened this issue Jan 26, 2020 · 3 comments
Closed

System.cmd should call magick mogrify instead of mogrify #85

Ziinc opened this issue Jan 26, 2020 · 3 comments

Comments

@Ziinc
Copy link

Ziinc commented Jan 26, 2020

When using the portable binary version of imagemagick, the correct command on unix systems is magick mogrify.

https://github.com/route/mogrify/blob/master/lib/mogrify.ex#L381

the direct call to mogrify would only apply when installed from source (if i'm not mistaken).
I receive the following error tuple when attempting to save using Mogrify.save/2:

{:error, %ErlangError{original: :enoent}}

Full error is as follows:

iex(1)> Mogrify.open("~/Downloads/test.jpg") |> Mogrify.save()
** (ErlangError) Erlang error: :enoent
    (elixir) lib/system.ex:791: System.cmd("mogrify", ["-write", "/tmp/255784-test.jpg", "/home/ziinc/Downloads/test.jpg"], [stderr_to_stdout: true])
    (mogrify) lib/mogrify.ex:28: Mogrify.save/2
iex(1)> 

I have tried writing a bash function in ~/.bashrc that points to magick but I think System.cmd calls the sh instead.

@mchavezi
Copy link

In case someone else comes across this issue, I am not sure this is related, but I was able to solve similar error I was having only when using Docker container (Homebrew works fine). I had to add imagemagick-dev as well imagemagick to final build to fix.

@talklittle
Copy link
Collaborator

This library adds ImageMagick executable path configuration support in v0.8.0 (#89). Hopefully that helps with this issue.

@talklittle
Copy link
Collaborator

This is manageable by adding to config.exs:

config :mogrify, mogrify_command: [
    path: "magick",
    args: ["mogrify"]
]
config :mogrify, convert_command: [
    path: "magick",
    args: ["convert"]
]
config :mogrify, identify_command: [
    path: "magick",
    args: ["identify"]
]

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants