From 25d867a213d920da5481fc2b9105e715c86ba1b8 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 22 Dec 2019 19:10:25 -0500 Subject: [PATCH] fix svg download link showing as png --- lib/philomena_web/views/image_view.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/philomena_web/views/image_view.ex b/lib/philomena_web/views/image_view.ex index 220dfe70..9cca6d7e 100644 --- a/lib/philomena_web/views/image_view.ex +++ b/lib/philomena_web/views/image_view.ex @@ -83,7 +83,7 @@ defmodule PhilomenaWeb.ImageView do image.image_format |> to_string() |> String.downcase() - |> thumb_format(name) + |> thumb_format(name, false) id_fragment = if deleted and show_hidden do @@ -105,7 +105,7 @@ defmodule PhilomenaWeb.ImageView do image.image_format |> to_string() |> String.downcase() - |> thumb_format(nil) + |> thumb_format(nil, download) "#{root}/#{view}/#{year}/#{month}/#{day}/#{filename}.#{format}" end @@ -184,9 +184,9 @@ defmodule PhilomenaWeb.ImageView do end end - defp thumb_format("svg", _name), do: "png" - defp thumb_format(_, :rendered), do: "png" - defp thumb_format(format, _name), do: format + defp thumb_format("svg", _name, false), do: "png" + defp thumb_format(_, :rendered, _download), do: "png" + defp thumb_format(format, _name, _download), do: format defp image_filter_data(image) do %{