Verify webp files are not processed with exiftool
authorMark Felder <feld@FreeBSD.org>
Fri, 4 Sep 2020 22:50:16 +0000 (17:50 -0500)
committerrinpatch <rinpatch@sdf.org>
Tue, 8 Sep 2020 09:29:38 +0000 (12:29 +0300)
test/upload/filter/exiftool_test.exs

index 094253a25d3b5374699022befce1d14bd4768c1c..fe24036d93411b46532a9d9d1eb63c250a42f149 100644 (file)
@@ -30,4 +30,15 @@ defmodule Pleroma.Upload.Filter.ExiftoolTest do
     assert String.match?(exif_original, ~r/GPS/)
     refute String.match?(exif_filtered, ~r/GPS/)
   end
+
+  test "verify webp files are skipped" do
+    upload = %Pleroma.Upload{
+      name: "sample.webp",
+      content_type: "image/webp",
+      path: Path.absname("/dev/null"),
+      tempfile: Path.absname("/dev/null")
+    }
+
+    assert Filter.Exiftool.filter(upload) == {:ok, :noop}
+  end
 end