ex_magick v0.2.4 ExMagick
Link to this section Summary
Functions
Generate the command builder struct
Output the image from command builder
Set an option to the command builder
Set a file by base64 encoded image to the command builder
Set a file by RGB color to the command builder
Set a file path to the command builder
Link to this section Functions
Link to this function
init()
Generate the command builder struct.
Examples
iex> ExMagick.init()
%ExMagick.CommandBuilder{command: "convert", args: []}
Link to this function
output(builder, output_path)
Output the image from command builder.
Examples
iex> ExMagick.init()
...> |> ExMagick.put_args("size", "150x150")
...> |> ExMagick.put_color("#00aaff")
...> |> ExMagick.output("tmp/output.png")
{:ok, "tmp/output.png"}
iex> {result, _} =
...> ExMagick.init()
...> |> ExMagick.put_color("invalid_color_code")
...> |> ExMagick.output("tmp/output.png")
iex> result
:error
Link to this function
output!(builder, output_path)
Link to this function
put_args(builder, key, value \\ nil, opts \\ [])
Set an option to the command builder.
Examples
iex> ExMagick.init()
...> |> ExMagick.put_args("size", "150x150")
%ExMagick.CommandBuilder{command: "convert", args: ["-size", "150x150"]}
Link to this function
put_base64_image(builder, encoded_image)
Set a file by base64 encoded image to the command builder.
Examples
iex> ExMagick.init()
...> |> ExMagick.put_base64_image("data:image/png;base64,....")
%ExMagick.CommandBuilder{command: "convert", args: ["inline:data:data:image/png;base64,...."]}
Link to this function
put_color(builder, rgb, opts \\ [fill: :fill])
Set a file by RGB color to the command builder.
Examples
iex> ExMagick.init()
...> |> ExMagick.put_color("#00aaff")
%ExMagick.CommandBuilder{command: "convert", args: ["xc:#00aaff"]}
iex> ExMagick.init()
...> |> ExMagick.put_color("#00aaff-#ffaa00", fill: :gradient)
%ExMagick.CommandBuilder{command: "convert", args: ["gradient:#00aaff-#ffaa00"]}
Link to this function
put_image(builder, path)
Set a file path to the command builder.
Examples
iex> ExMagick.init()
...> |> ExMagick.put_image("test.png")
%ExMagick.CommandBuilder{command: "convert", args: ["test.png"]}