ex_magick v0.2.2 ExMagick

Link to this section Summary

Functions

Generate the command builder struct

Output the image from 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

Set an option to the command builder

Link to this section Functions

Generate the command builder struct.

Examples

iex> ExMagick.init()
%ExMagick.CommandBuilder{command: "convert", options: []}
Link to this function output(builder, output_path)

Output the image from command builder.

Examples

iex> ExMagick.init()
...> |> ExMagick.put_option("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_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", options: ["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", options: ["xc:#00aaff"]}
iex> ExMagick.init()
...> |> ExMagick.put_color("#00aaff-#ffaa00", fill: :gradient)
%ExMagick.CommandBuilder{command: "convert", options: ["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", options: ["test.png"]}
Link to this function put_option(builder, key, value)

Set an option to the command builder.

Examples

iex> ExMagick.init()
...> |> ExMagick.put_option("size", "150x150")
%ExMagick.CommandBuilder{command: "convert", options: ["-size", "150x150"]}