text alignment for widthxheight images
This commit is contained in:
@@ -20,8 +20,8 @@ defmodule LabelmakerWeb.LabelController do
|
||||
|
||||
unless File.exists?(filepath) do
|
||||
basic_settings(options)
|
||||
|> size_settings(options)
|
||||
|> outline_settings(options)
|
||||
|> size_settings(options)
|
||||
|> final_settings(options)
|
||||
|> generate_image()
|
||||
end
|
||||
@@ -51,11 +51,11 @@ defmodule LabelmakerWeb.LabelController do
|
||||
]
|
||||
end
|
||||
|
||||
defp size_settings(args, %{align: align, height: height, width: width} = options) do
|
||||
defp size_settings(args, %{align: alignment, height: height, width: width} = options) do
|
||||
args ++
|
||||
[
|
||||
"-gravity",
|
||||
align,
|
||||
Tools.process_gravity(alignment),
|
||||
"-size",
|
||||
"#{width}x#{height}",
|
||||
"caption:#{String.slice(options.label, 0, Constants.max_label_length())}"
|
||||
@@ -87,9 +87,6 @@ defmodule LabelmakerWeb.LabelController do
|
||||
defp generate_image(args) do
|
||||
File.mkdir_p!(@label_dir)
|
||||
|
||||
# IO.puts("-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-")
|
||||
# IO.inspect(args)
|
||||
|
||||
{_, 0} = System.cmd("magick", args)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user