respect scale settings

This commit is contained in:
byte[] 2019-12-09 20:28:00 -05:00
parent 2a1ceb421e
commit 0d1ae1e436
2 changed files with 4 additions and 1 deletions

View file

@ -8,7 +8,7 @@
=< link("your current filter", to: Routes.filter_path(@conn, :show, @conn.assigns.current_filter), class: "filter-link")
' .
#image_target.hidden.image-show data-scaled="true" data-uris=Jason.encode!(thumb_urls(@image, can?(@conn, :hide, @image))) data-width=@image.image_width data-height=@image.image_height
#image_target.hidden.image-show data-scaled=scaled_value(@conn.assigns.current_user) data-uris=Jason.encode!(thumb_urls(@image, can?(@conn, :hide, @image))) data-width=@image.image_width data-height=@image.image_height
= if @image.image_mime_type == "video/webm" do
video controls=true
- else

View file

@ -159,6 +159,9 @@ defmodule PhilomenaWeb.ImageView do
def deleter(%{deleter: %{name: name}}), do: name
def deleter(_image), do: "System"
def scaled_value(%{scale_large_images: false}), do: "false"
def scaled_value(_user), do: "true"
defp thumb_format("svg", _name), do: "png"
defp thumb_format(_, :rendered), do: "png"
defp thumb_format(format, _name), do: format