upload: strip exif data before finalizing the file path
authorWilliam Pitcock <nenolod@dereferenced.org>
Mon, 27 Aug 2018 23:36:30 +0000 (23:36 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Mon, 27 Aug 2018 23:36:30 +0000 (23:36 +0000)
lib/pleroma/upload.ex

index e0cb545b0b9adba94b6ceaf574bf5a5cc4375992..eaff8fbf36812856c28108bd9c0f720552ea56e7 100644 (file)
@@ -9,6 +9,8 @@ defmodule Pleroma.Upload do
     upload_folder = get_upload_path(uuid, should_dedupe)
     url_path = get_url(name, uuid, should_dedupe)
 
+    strip_exif_data(content_type, file.path)
+
     File.mkdir_p!(upload_folder)
     result_file = Path.join(upload_folder, name)
 
@@ -18,8 +20,6 @@ defmodule Pleroma.Upload do
       File.cp!(file.path, result_file)
     end
 
-    strip_exif_data(content_type, result_file)
-
     %{
       "type" => "Document",
       "url" => [