Getting "is invalid" error with Arc library in Phoenix application when using transform

It won’t…

But You can test platform with

iex> :os.type
{:unix, :darwin}

Thank you, my transform is now

def transform(:thumb, _) do
  case :os.type do
    {:win32, :nt} ->
      {:magick, fn(input, output) -> "convert #{input} -strip -thumbnail 100x100^ -gravity center -extent 100x100 #{output}" end}
    _ ->
      {:convert, "-strip -thumbnail 100x100^ -gravity center -extent 100x100"}
  end
end

NOTE: If you are running your phoenix application from git-bash in windows, you need to add the location of imagemagick to your PATH environment variable.

In doubt… I would

{:win32, _}

Nice You got it working. Don’t forget your validation, because it can really fail.

1 Like