diff options
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", |