Resize images to 100 pixels before hashing
This commit is contained in:
parent
0c6a54b37c
commit
88cc7e6a04
|
@ -83,7 +83,7 @@ defp media_dimensions(file) do
|
|||
end
|
||||
|
||||
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)}
|
||||
max = max(height, width)
|
||||
{x, y} = {max(round(width * 5 / max), 1), max(round(height * 5 / max), 1)}
|
||||
|
|
Loading…
Reference in New Issue