chore: apply mix format to codebase
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -31,7 +31,8 @@ defmodule SimpleshopTheme.Images.Optimizer do
|
||||
{width, _height, _} <- Image.shape(image),
|
||||
{:ok, resized} <- maybe_resize(image, width),
|
||||
{final_width, final_height, _} <- Image.shape(resized),
|
||||
{:ok, webp_data} <- Image.write(resized, :memory, suffix: ".webp", quality: @storage_quality) do
|
||||
{:ok, webp_data} <-
|
||||
Image.write(resized, :memory, suffix: ".webp", quality: @storage_quality) do
|
||||
{:ok, webp_data, final_width, final_height}
|
||||
end
|
||||
rescue
|
||||
@@ -191,9 +192,20 @@ defmodule SimpleshopTheme.Images.Optimizer do
|
||||
widths = applicable_widths(source_width)
|
||||
|
||||
tasks = [
|
||||
Task.async(fn -> generate_variant_to_dir(vips_image, output_basename, output_dir, "thumb", :jpg, @thumb_size) end)
|
||||
Task.async(fn ->
|
||||
generate_variant_to_dir(
|
||||
vips_image,
|
||||
output_basename,
|
||||
output_dir,
|
||||
"thumb",
|
||||
:jpg,
|
||||
@thumb_size
|
||||
)
|
||||
end)
|
||||
| for w <- widths, fmt <- @pregenerated_formats do
|
||||
Task.async(fn -> generate_variant_to_dir(vips_image, output_basename, output_dir, w, fmt, w) end)
|
||||
Task.async(fn ->
|
||||
generate_variant_to_dir(vips_image, output_basename, output_dir, w, fmt, w)
|
||||
end)
|
||||
end
|
||||
]
|
||||
|
||||
|
||||
@@ -59,7 +59,9 @@ defmodule SimpleshopTheme.Images.VariantCache do
|
||||
if to_process == [] do
|
||||
Logger.info("[VariantCache] All database image variants up to date")
|
||||
else
|
||||
Logger.info("[VariantCache] Enqueueing #{length(to_process)} database images for processing")
|
||||
Logger.info(
|
||||
"[VariantCache] Enqueueing #{length(to_process)} database images for processing"
|
||||
)
|
||||
|
||||
Enum.each(to_process, fn image ->
|
||||
image
|
||||
|
||||
Reference in New Issue
Block a user