summaryrefslogtreecommitdiff
path: root/test/mix/tasks
diff options
context:
space:
mode:
authorIlja <ilja@ilja.space>2022-02-14 13:14:25 +0100
committerIlja <ilja@ilja.space>2022-07-01 12:13:46 +0200
commitcd316d7269a6cac1e9edb732b202343001b82399 (patch)
tree05a05342f28644c142bb7f280dcf928a8801c38a /test/mix/tasks
parent75f912c63f9a18e37f8ddbd403755b878467435a (diff)
downloadpleroma-cd316d7269a6cac1e9edb732b202343001b82399.tar.gz
pleroma-cd316d7269a6cac1e9edb732b202343001b82399.zip
Use EXIF data of image to prefill image description
During attachment upload Pleroma returns a "description" field. Pleroma-fe has an MR to use that to pre-fill the image description field, <https://git.pleroma.social/pleroma/pleroma-fe/-/merge_requests/1399> * This MR allows Pleroma to read the EXIF data during upload and return the description to the FE * If a description is already present (e.g. because a previous module added it), it will use that * Otherwise it will read from the EXIF data. First it will check -ImageDescription, if that's empty, it will check -iptc:Caption-Abstract * If no description is found, it will simply return nil, just like before * When people set up a new instance, they will be asked if they want to read metadata and this module will be activated if so This was taken from an MR i did on Pleroma and isn't finished yet.
Diffstat (limited to 'test/mix/tasks')
-rw-r--r--test/mix/tasks/pleroma/instance_test.exs7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/mix/tasks/pleroma/instance_test.exs b/test/mix/tasks/pleroma/instance_test.exs
index 249689ec6..e72aab701 100644
--- a/test/mix/tasks/pleroma/instance_test.exs
+++ b/test/mix/tasks/pleroma/instance_test.exs
@@ -69,6 +69,8 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do
"./test/../test/instance/static/",
"--strip-uploads",
"y",
+ "--read-uploads-data",
+ "y",
"--dedupe-uploads",
"n",
"--anonymize-uploads",
@@ -91,7 +93,10 @@ defmodule Mix.Tasks.Pleroma.InstanceTest do
assert generated_config =~ "password: \"dbpass\""
assert generated_config =~ "configurable_from_database: true"
assert generated_config =~ "http: [ip: {127, 0, 0, 1}, port: 4000]"
- assert generated_config =~ "filters: [Pleroma.Upload.Filter.Exiftool]"
+
+ assert generated_config =~
+ "filters: [Pleroma.Upload.Filter.Exiftool, Pleroma.Upload.Filter.ExiftoolReadData]"
+
assert File.read!(tmp_path() <> "setup.psql") == generated_setup_psql()
assert File.exists?(Path.expand("./test/instance/static/robots.txt"))
end