mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-23 19:35:03 +01:00
filter exif data #187
This commit is contained in:
parent
fc012491a5
commit
cb21bf5fc2
@ -10,7 +10,9 @@ config :pleroma, ecto_repos: [Pleroma.Repo]
|
||||
|
||||
config :pleroma, Pleroma.Repo, types: Pleroma.PostgresTypes
|
||||
|
||||
config :pleroma, Pleroma.Upload, uploads: "uploads"
|
||||
config :pleroma, Pleroma.Upload,
|
||||
uploads: "uploads",
|
||||
strip_exif: false
|
||||
|
||||
# Configures the endpoint
|
||||
config :pleroma, Pleroma.Web.Endpoint,
|
||||
|
@ -80,6 +80,14 @@ defmodule Pleroma.Upload do
|
||||
}
|
||||
end
|
||||
|
||||
def strip_exif_data(file) do
|
||||
settings = Application.get_env(:pleroma, Pleroma.Upload)
|
||||
@do_strip = Keyword.fetch!(settings, :strip_exif)
|
||||
if @do_strip == true do
|
||||
Mogrify.open(file) |> Mogrify.custom("strip") |> Mogrify.save(in_place: true)
|
||||
end
|
||||
end
|
||||
|
||||
def upload_path do
|
||||
settings = Application.get_env(:pleroma, Pleroma.Upload)
|
||||
Keyword.fetch!(settings, :uploads)
|
||||
|
Loading…
Reference in New Issue
Block a user