total rebase
[anni] / test / pleroma / upload / filter / analyze_metadata_test.exs
old mode 100755 (executable)
new mode 100644 (file)
index b800a4a..e4ac673
@@ -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",