Resize images to 100 pixels before hashing

This commit is contained in:
Mark Felder 2023-11-17 11:06:31 -05:00
parent 0c6a54b37c
commit 88cc7e6a04
1 changed files with 1 additions and 1 deletions

View File

@ -83,7 +83,7 @@ defp media_dimensions(file) do
end end
defp vips_blurhash(image = %Vix.Vips.Image{}) do defp vips_blurhash(image = %Vix.Vips.Image{}) do
{:ok, resized_image} = Operation.thumbnail_image(image, 20) {:ok, resized_image} = Operation.thumbnail_image(image, 100)
{height, width} = {Image.height(resized_image), Image.width(resized_image)} {height, width} = {Image.height(resized_image), Image.width(resized_image)}
max = max(height, width) max = max(height, width)
{x, y} = {max(round(width * 5 / max), 1), max(round(height * 5 / max), 1)} {x, y} = {max(round(width * 5 / max), 1), max(round(height * 5 / max), 1)}