From 86c007ddd2a059e1d98780872abe30f92a24fbbf Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Mon, 27 Aug 2018 23:36:30 +0000 Subject: [PATCH] upload: strip exif data before finalizing the file path --- lib/pleroma/upload.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/upload.ex b/lib/pleroma/upload.ex index e0cb545b0..eaff8fbf3 100644 --- a/lib/pleroma/upload.ex +++ b/lib/pleroma/upload.ex @@ -9,6 +9,8 @@ def store(%Plug.Upload{} = file, should_dedupe) 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 @@ def store(%Plug.Upload{} = file, should_dedupe) do File.cp!(file.path, result_file) end - strip_exif_data(content_type, result_file) - %{ "type" => "Document", "url" => [