AnalyzeMetadata: Switch to rinpatch_blurhash

This commit is contained in:
Lain Soykaf 2023-11-28 12:23:41 +04:00
commit 03db495e1d
5 changed files with 25 additions and 13 deletions

BIN
test/fixtures/png_with_transparency.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

View file

@ -20,6 +20,20 @@ defmodule Pleroma.Upload.Filter.AnalyzeMetadataTest do
assert meta.blurhash
end
test "it blurhashes images with an alpha component" do
upload = %Pleroma.Upload{
name: "an… image.jpg",
content_type: "image/jpeg",
path: Path.absname("test/fixtures/png_with_transparency.png"),
tempfile: Path.absname("test/fixtures/png_with_transparency.png")
}
{:ok, :filtered, meta} = AnalyzeMetadata.filter(upload)
assert %{width: 320, height: 320} = meta
assert meta.blurhash == "eXJi-E:SwCEm5rCmn$+YWYn+15K#5A$xxCi{SiV]s*W:Efa#s.jE-T"
end
test "adds the dimensions for videos" do
upload = %Pleroma.Upload{
name: "coolvideo.mp4",