diff options
Diffstat (limited to 'lib/pleroma/upload.ex')
-rw-r--r-- | lib/pleroma/upload.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/upload.ex b/lib/pleroma/upload.ex index 762d813d9..797555bff 100644 --- a/lib/pleroma/upload.ex +++ b/lib/pleroma/upload.ex @@ -67,6 +67,7 @@ defmodule Pleroma.Upload do {:ok, %{ "type" => opts.activity_type, + "mediaType" => upload.content_type, "url" => [ %{ "type" => "Link", @@ -134,7 +135,7 @@ defmodule Pleroma.Upload do end end - defp prepare_upload(%{"img" => "data:image/" <> image_data}, opts) do + defp prepare_upload(%{img: "data:image/" <> image_data}, opts) do parsed = Regex.named_captures(~r/(?<filetype>jpeg|png|gif);base64,(?<data>.*)/, image_data) data = Base.decode64!(parsed["data"], ignore: :whitespace) hash = String.downcase(Base.encode16(:crypto.hash(:sha256, data))) |