projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge remote-tracking branch 'remotes/origin/develop' into ostatus-controller-no...
[akkoma]
/
test
/
upload
/
filter
/
exiftool_test.exs
diff --git
a/test/upload/filter/exiftool_test.exs
b/test/upload/filter/exiftool_test.exs
index a1b7e46cd3e84acd82e4822fc1400bd3a739ab51..d4cd4ba1145eb2e50f996bb41d60196972522159 100644
(file)
--- a/
test/upload/filter/exiftool_test.exs
+++ b/
test/upload/filter/exiftool_test.exs
@@
-7,6
+7,8
@@
defmodule Pleroma.Upload.Filter.ExiftoolTest do
alias Pleroma.Upload.Filter
test "apply exiftool filter" do
alias Pleroma.Upload.Filter
test "apply exiftool filter" do
+ assert Pleroma.Utils.command_available?("exiftool")
+
File.cp!(
"test/fixtures/DSCN0010.jpg",
"test/fixtures/DSCN0010_tmp.jpg"
File.cp!(
"test/fixtures/DSCN0010.jpg",
"test/fixtures/DSCN0010_tmp.jpg"
@@
-19,7
+21,7
@@
defmodule Pleroma.Upload.Filter.ExiftoolTest do
tempfile: Path.absname("test/fixtures/DSCN0010_tmp.jpg")
}
tempfile: Path.absname("test/fixtures/DSCN0010_tmp.jpg")
}
- assert Filter.Exiftool.filter(upload) ==
:ok
+ assert Filter.Exiftool.filter(upload) ==
{:ok, :filtered}
{exif_original, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010.jpg"])
{exif_filtered, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010_tmp.jpg"])
{exif_original, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010.jpg"])
{exif_filtered, 0} = System.cmd("exiftool", ["test/fixtures/DSCN0010_tmp.jpg"])
@@
-28,4
+30,13
@@
defmodule Pleroma.Upload.Filter.ExiftoolTest do
assert String.match?(exif_original, ~r/GPS/)
refute String.match?(exif_filtered, ~r/GPS/)
end
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"
+ }
+
+ assert Filter.Exiftool.filter(upload) == {:ok, :noop}
+ end
end
end