mirror of
https://github.com/philomena-dev/philomena.git
synced 2024-11-30 14:57:59 +01:00
fix svg download link showing as png
This commit is contained in:
parent
f9b810d5d1
commit
25d867a213
1 changed files with 5 additions and 5 deletions
|
@ -83,7 +83,7 @@ defmodule PhilomenaWeb.ImageView do
|
||||||
image.image_format
|
image.image_format
|
||||||
|> to_string()
|
|> to_string()
|
||||||
|> String.downcase()
|
|> String.downcase()
|
||||||
|> thumb_format(name)
|
|> thumb_format(name, false)
|
||||||
|
|
||||||
id_fragment =
|
id_fragment =
|
||||||
if deleted and show_hidden do
|
if deleted and show_hidden do
|
||||||
|
@ -105,7 +105,7 @@ defmodule PhilomenaWeb.ImageView do
|
||||||
image.image_format
|
image.image_format
|
||||||
|> to_string()
|
|> to_string()
|
||||||
|> String.downcase()
|
|> String.downcase()
|
||||||
|> thumb_format(nil)
|
|> thumb_format(nil, download)
|
||||||
|
|
||||||
"#{root}/#{view}/#{year}/#{month}/#{day}/#{filename}.#{format}"
|
"#{root}/#{view}/#{year}/#{month}/#{day}/#{filename}.#{format}"
|
||||||
end
|
end
|
||||||
|
@ -184,9 +184,9 @@ defmodule PhilomenaWeb.ImageView do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
defp thumb_format("svg", _name), do: "png"
|
defp thumb_format("svg", _name, false), do: "png"
|
||||||
defp thumb_format(_, :rendered), do: "png"
|
defp thumb_format(_, :rendered, _download), do: "png"
|
||||||
defp thumb_format(format, _name), do: format
|
defp thumb_format(format, _name, _download), do: format
|
||||||
|
|
||||||
defp image_filter_data(image) do
|
defp image_filter_data(image) do
|
||||||
%{
|
%{
|
||||||
|
|
Loading…
Reference in a new issue