- Fix whole_word always returning false on filter get requests
- Migrations not working on OTP releases if the database was connected over ssl
- Fix relay following
+- Fixed uploading webp images when the Exiftool Upload Filter is enabled
## [2.0.7] - 2020-06-13
@behaviour Pleroma.Upload.Filter
@spec filter(Pleroma.Upload.t()) :: :ok | {:error, String.t()}
- def filter(%Pleroma.Upload{tempfile: file, content_type: "image" <> _}) do
+ def filter(%Pleroma.Upload{name: file, tempfile: path, content_type: "image" <> _}) do
+ # webp is not compatible with exiftool at this time
+ if Regex.match?(~r/\.(webp)$/i, file) do
+ :ok
+ else
+ strip_exif(path)
+ end
+ end
+
+ def filter(_), do: :ok
+
+ defp strip_exif(path) do
try do
- case System.cmd("exiftool", ["-overwrite_original", "-gps:all=", file], parallelism: true) do
+ case System.cmd("exiftool", ["-overwrite_original", "-gps:all=", path], parallelism: true) do
{_response, 0} -> :ok
{error, 1} -> {:error, error}
end
{:error, "exiftool command not found"}
end
end
-
- def filter(_), do: :ok
end