mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
Resize images to 100 pixels before hashing
This commit is contained in:
parent
0c6a54b37c
commit
88cc7e6a04
1 changed files with 1 additions and 1 deletions
|
@ -83,7 +83,7 @@ defmodule Pleroma.Upload.Filter.AnalyzeMetadata 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)}
|
||||||
|
|
Loading…
Reference in a new issue