text alignment for widthxheight images

This commit is contained in:
Gavin McDonald
2025-08-24 11:13:18 -04:00
parent 3ab19e01fd
commit a981cf98d7
6 changed files with 69 additions and 60 deletions

View File

@@ -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