From adb0a01d0a0d81a47cafb908684589602bed6ac0 Mon Sep 17 00:00:00 2001 From: ihor Date: Thu, 5 Jan 2023 14:09:01 +0000 Subject: [PATCH 1/4] fix "exiftool not support svg files' --- lib/pleroma/upload/filter/exiftool.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/upload/filter/exiftool.ex b/lib/pleroma/upload/filter/exiftool.ex index a2bfbbf61..2bfa3c0aa 100644 --- a/lib/pleroma/upload/filter/exiftool.ex +++ b/lib/pleroma/upload/filter/exiftool.ex @@ -14,7 +14,8 @@ defmodule Pleroma.Upload.Filter.Exiftool do # Formats not compatible with exiftool at this time def filter(%Pleroma.Upload{content_type: "image/heic"}), do: {:ok, :noop} def filter(%Pleroma.Upload{content_type: "image/webp"}), do: {:ok, :noop} - + def filter(%Pleroma.Upload{content_type: "image/svg+xml"}), do: {:ok, :noop} + def filter(%Pleroma.Upload{tempfile: file, content_type: "image" <> _}) do try do case System.cmd("exiftool", ["-overwrite_original", "-gps:all=", file], parallelism: true) do -- 2.43.0 From 064a68793f89ed6874ee8181c30c76bcc75fa969 Mon Sep 17 00:00:00 2001 From: ihor Date: Thu, 5 Jan 2023 14:50:26 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=D0=9E=D0=BD=D0=BE=D0=B2=D0=B8=D1=82=D0=B8?= =?UTF-8?q?=20'lib/pleroma/upload/filter/exiftool.ex'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/pleroma/upload/filter/exiftool.ex | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/pleroma/upload/filter/exiftool.ex b/lib/pleroma/upload/filter/exiftool.ex index 2bfa3c0aa..511a05622 100644 --- a/lib/pleroma/upload/filter/exiftool.ex +++ b/lib/pleroma/upload/filter/exiftool.ex @@ -15,7 +15,6 @@ defmodule Pleroma.Upload.Filter.Exiftool do def filter(%Pleroma.Upload{content_type: "image/heic"}), do: {:ok, :noop} def filter(%Pleroma.Upload{content_type: "image/webp"}), do: {:ok, :noop} def filter(%Pleroma.Upload{content_type: "image/svg+xml"}), do: {:ok, :noop} - def filter(%Pleroma.Upload{tempfile: file, content_type: "image" <> _}) do try do case System.cmd("exiftool", ["-overwrite_original", "-gps:all=", file], parallelism: true) do -- 2.43.0 From 23b90698a89391ff20f85709b356dda3ec64faa1 Mon Sep 17 00:00:00 2001 From: ihor Date: Thu, 5 Jan 2023 15:07:36 +0000 Subject: [PATCH 3/4] fix format --- lib/pleroma/upload/filter/exiftool.ex | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/pleroma/upload/filter/exiftool.ex b/lib/pleroma/upload/filter/exiftool.ex index 511a05622..8b2821ab0 100644 --- a/lib/pleroma/upload/filter/exiftool.ex +++ b/lib/pleroma/upload/filter/exiftool.ex @@ -14,6 +14,7 @@ defmodule Pleroma.Upload.Filter.Exiftool do # Formats not compatible with exiftool at this time def filter(%Pleroma.Upload{content_type: "image/heic"}), do: {:ok, :noop} def filter(%Pleroma.Upload{content_type: "image/webp"}), do: {:ok, :noop} + def filter(%Pleroma.Upload{content_type: "image/svg+xml"}), do: {:ok, :noop} def filter(%Pleroma.Upload{tempfile: file, content_type: "image" <> _}) do try do -- 2.43.0 From ca497408cbe79170701a735b9226532526eb5ed1 Mon Sep 17 00:00:00 2001 From: ihor Date: Thu, 5 Jan 2023 15:07:56 +0000 Subject: [PATCH 4/4] fix format --- lib/pleroma/upload/filter/exiftool.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pleroma/upload/filter/exiftool.ex b/lib/pleroma/upload/filter/exiftool.ex index 8b2821ab0..6b68f7f8a 100644 --- a/lib/pleroma/upload/filter/exiftool.ex +++ b/lib/pleroma/upload/filter/exiftool.ex @@ -14,8 +14,8 @@ defmodule Pleroma.Upload.Filter.Exiftool do # Formats not compatible with exiftool at this time def filter(%Pleroma.Upload{content_type: "image/heic"}), do: {:ok, :noop} def filter(%Pleroma.Upload{content_type: "image/webp"}), do: {:ok, :noop} - def filter(%Pleroma.Upload{content_type: "image/svg+xml"}), do: {:ok, :noop} + def filter(%Pleroma.Upload{tempfile: file, content_type: "image" <> _}) do try do case System.cmd("exiftool", ["-overwrite_original", "-gps:all=", file], parallelism: true) do -- 2.43.0