diff options
author | Lain Soykaf <lain@lain.com> | 2023-11-28 12:23:41 +0400 |
---|---|---|
committer | Lain Soykaf <lain@lain.com> | 2023-11-28 12:23:41 +0400 |
commit | 03db495e1d88f34bef8d556b0f88806c3260d403 (patch) | |
tree | 22057cc3651ea7069f2b1777d35a1187436a0691 /test | |
parent | 299c548b124377e51f6c089bc0df31b2989be3ef (diff) | |
download | pleroma-03db495e1d88f34bef8d556b0f88806c3260d403.tar.gz pleroma-03db495e1d88f34bef8d556b0f88806c3260d403.zip |
AnalyzeMetadata: Switch to rinpatch_blurhash
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/png_with_transparency.png | bin | 0 -> 84250 bytes | |||
-rw-r--r-- | test/pleroma/upload/filter/analyze_metadata_test.exs | 14 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/fixtures/png_with_transparency.png b/test/fixtures/png_with_transparency.png Binary files differnew file mode 100644 index 000000000..7963149db --- /dev/null +++ b/test/fixtures/png_with_transparency.png diff --git a/test/pleroma/upload/filter/analyze_metadata_test.exs b/test/pleroma/upload/filter/analyze_metadata_test.exs index b800a4a43..e4ac673b2 100644 --- a/test/pleroma/upload/filter/analyze_metadata_test.exs +++ b/test/pleroma/upload/filter/analyze_metadata_test.exs @@ -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", |