diff options
author | lain <lain@soykaf.club> | 2023-02-13 17:10:58 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2023-02-13 17:10:58 +0000 |
commit | 19933a06bf9759bd3ec3cbe63f064039a659c656 (patch) | |
tree | 363ac99d6aa3764c3b183b883e366e6d760c9b8b /test | |
parent | a5509de389ada99a6ac8aae027e77ccb1355f06d (diff) | |
parent | 024bb27fc70b7352610a6d1b73a7af2f09465edd (diff) | |
download | pleroma-19933a06bf9759bd3ec3cbe63f064039a659c656.tar.gz pleroma-19933a06bf9759bd3ec3cbe63f064039a659c656.zip |
Merge branch 'tusooa/exiftool' into 'develop'
Ignores in exiftool read descriptions
See merge request pleroma/pleroma!3840
Diffstat (limited to 'test')
-rw-r--r-- | test/fixtures/image_with_imagedescription_and_caption-abstract_and_stray_data_after.png | bin | 0 -> 820 bytes | |||
-rwxr-xr-x | test/fixtures/image_with_stray_data_after.png | bin | 0 -> 104435 bytes | |||
-rw-r--r-- | test/pleroma/upload/filter/exiftool/read_description_test.exs | 27 |
3 files changed, 27 insertions, 0 deletions
diff --git a/test/fixtures/image_with_imagedescription_and_caption-abstract_and_stray_data_after.png b/test/fixtures/image_with_imagedescription_and_caption-abstract_and_stray_data_after.png Binary files differnew file mode 100644 index 000000000..7ce8640fa --- /dev/null +++ b/test/fixtures/image_with_imagedescription_and_caption-abstract_and_stray_data_after.png diff --git a/test/fixtures/image_with_stray_data_after.png b/test/fixtures/image_with_stray_data_after.png Binary files differnew file mode 100755 index 000000000..a280e4377 --- /dev/null +++ b/test/fixtures/image_with_stray_data_after.png diff --git a/test/pleroma/upload/filter/exiftool/read_description_test.exs b/test/pleroma/upload/filter/exiftool/read_description_test.exs index 7389fda47..7cc83969d 100644 --- a/test/pleroma/upload/filter/exiftool/read_description_test.exs +++ b/test/pleroma/upload/filter/exiftool/read_description_test.exs @@ -42,6 +42,33 @@ defmodule Pleroma.Upload.Filter.Exiftool.ReadDescriptionTest do {:ok, :filtered, uploads_after} end + test "Ignores warnings" do + uploads = %Pleroma.Upload{ + name: "image_with_imagedescription_and_caption-abstract_and_stray_data_after.png", + content_type: "image/png", + path: + Path.absname( + "test/fixtures/image_with_imagedescription_and_caption-abstract_and_stray_data_after.png" + ), + tempfile: + Path.absname( + "test/fixtures/image_with_imagedescription_and_caption-abstract_and_stray_data_after.png" + ) + } + + assert {:ok, :filtered, %{description: "a descriptive white pixel"}} = + Filter.Exiftool.ReadDescription.filter(uploads) + + uploads = %Pleroma.Upload{ + name: "image_with_stray_data_after.png", + content_type: "image/png", + path: Path.absname("test/fixtures/image_with_stray_data_after.png"), + tempfile: Path.absname("test/fixtures/image_with_stray_data_after.png") + } + + assert {:ok, :filtered, %{description: nil}} = Filter.Exiftool.ReadDescription.filter(uploads) + end + test "otherwise returns iptc:Caption-Abstract when present" do upload = %Pleroma.Upload{ name: "image_with_caption-abstract.jpg", |