mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-08 09:24:18 +00:00
strip_metadata: skip BMP files
Not _yet_ supported as of exiftool 12.87, though at first glance it seems like standard BMP files can't store any metadata besides colour profiles Fixes the specific case from https://akkoma.dev/AkkomaGang/akkoma-fe/issues/396 although the frontend shouldn’t get bricked regardless.
This commit is contained in:
parent
cf19d4901f
commit
495a1a71e8
|
@ -18,6 +18,7 @@ defmodule Pleroma.Upload.Filter.Exiftool.StripMetadata do
|
|||
|
||||
# Formats not compatible with exiftool at this time
|
||||
def filter(%Pleroma.Upload{content_type: "image/webp"}), do: {:ok, :noop}
|
||||
def filter(%Pleroma.Upload{content_type: "image/bmp"}), 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
|
||||
|
|
|
@ -115,6 +115,15 @@ defmodule Pleroma.Upload.Filter.Exiftool.StripMetadataTest do
|
|||
assert Filter.Exiftool.StripMetadata.filter(upload) == {:ok, :noop}
|
||||
end
|
||||
|
||||
test "verify bmp files are skipped" do
|
||||
upload = %Pleroma.Upload{
|
||||
name: "sample.bmp",
|
||||
content_type: "image/bmp"
|
||||
}
|
||||
|
||||
assert Filter.Exiftool.StripMetadata.filter(upload) == {:ok, :noop}
|
||||
end
|
||||
|
||||
test "verify svg files are skipped" do
|
||||
upload = %Pleroma.Upload{
|
||||
name: "sample.svg",
|
||||
|
|
Loading…
Reference in a new issue