diff --git a/lib/philomena_web/templates/image/_image_target.html.slime b/lib/philomena_web/templates/image/_image_target.html.slime index 607c2bbf..febf65eb 100644 --- a/lib/philomena_web/templates/image/_image_target.html.slime +++ b/lib/philomena_web/templates/image/_image_target.html.slime @@ -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 diff --git a/lib/philomena_web/views/image_view.ex b/lib/philomena_web/views/image_view.ex index 9277e0cf..696b60fb 100644 --- a/lib/philomena_web/views/image_view.ex +++ b/lib/philomena_web/views/image_view.ex @@ -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