From: ihor Date: Thu, 5 Jan 2023 15:22:48 +0000 (+0000) Subject: fix "exiftool not support svg files' (#421) X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=b98fe4476c13f213f5a4c928b7946516374e133b;p=akkoma fix "exiftool not support svg files' (#421) Faced with this issue today, Pleroma responds with status 400 (Bad request) if Exiftool.StripLocation is added to the list of filter modules for uploads. Here is logs: ``` 13:27:25.201 [info] POST /api/v1/media 13:27:25.232 request_id=FzdspaAnrA6cyv0APgVR [error] Elixir.Pleroma.Upload.Filter: Filter Elixir.Pleroma.Upload.Filter.Exiftool.StripLocation failed: {:error, "Elixir.Pleroma.Upload.Filter.Exiftool.StripLocation: %ErlangError{original: :enoent}"} 13:27:25.232 request_id=FzdspaAnrA6cyv0APgVR [error] Elixir.Pleroma.Upload store (using Pleroma.Uploaders.Local) failed: "Elixir.Pleroma.Upload.Filter.Exiftool.StripLocation: %ErlangError{original: :enoent}" ``` # This fix solves this problem. Reviewed-on: https://akkoma.dev/AkkomaGang/akkoma/pulls/421 Co-authored-by: ihor Co-committed-by: ihor --- diff --git a/lib/pleroma/upload/filter/exiftool.ex b/lib/pleroma/upload/filter/exiftool.ex index 9e82cf8a7..8ada73473 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