format...
[akkoma] / lib / pleroma / upload.ex
index 43df0d418f193ff8e1dcb9a1856915dc8879ea20..e412e43fa5add67660e7883cffda5cd9089c85a0 100644 (file)
@@ -80,6 +80,15 @@ 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)