basic controls

This commit is contained in:
Gavin McDonald
2025-04-30 17:26:14 -04:00
parent 96cb9f6f7f
commit 074de63282
2 changed files with 53 additions and 18 deletions

View File

@@ -19,12 +19,11 @@ defmodule LabelmakerWeb.Label do
|> Map.merge(params)
|> Map.take(@permitted_keys)
IO.inspect(options)
filename = "#{options["label"]}.png"
filepath = Path.join(@label_dir, filename)
unless File.exists?(filepath) do
generate_label_image(options, filepath)
generate_image(options, filepath)
end
{:ok,
@@ -43,7 +42,7 @@ defmodule LabelmakerWeb.Label do
"""
end
defp generate_label_image(options, filepath) do
defp generate_image(options, filepath) do
args = [
"-background",
"none",
@@ -58,14 +57,5 @@ defmodule LabelmakerWeb.Label do
]
{_, 0} = System.cmd("magick", args)
IO.puts(filepath)
# png_binary = File.read!(filepath)
# File.rm(tmp_file)
# Base.encode64(png_binary)
end
# defp get_image_settings(socket) do
#
# end
end