1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Upload.Filter.Exiftool do
7 Strips GPS related EXIF tags and overwrites the file in place.
8 Also strips or replaces filesystem metadata e.g., timestamps.
10 @behaviour Pleroma.Upload.Filter
12 @type conversion :: action :: String.t() | {action :: String.t(), opts :: String.t()}
13 @type conversions :: conversion() | [conversion()]
15 def filter(%Pleroma.Upload{tempfile: file, content_type: "image" <> _}) do
16 System.cmd("exiftool", ["-overwrite_original", "-gps:all=", file], parallelism: true)
20 def filter(_), do: :ok