Skip to content

Commit

Permalink
small fix for 3322b44
Browse files Browse the repository at this point in the history
fixes #16
  • Loading branch information
ebenenglish committed Jan 22, 2021
1 parent e093564 commit 362f483
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ def render_collection_image(image_tag_class = nil)
# preferred dimensions: 1100 width, 450 height
def collection_image_url(image_pid, target_width = 1100, target_height = 450)
image_info = get_image_metadata(image_pid)
if image_info[:aspect_ratio] > 2.2
output_aspect = target_width.to_f / target_height.to_f
if image_info[:aspect_ratio] > output_aspect
top = 0
height = image_info[:height]
output_aspect = target_width.to_f / target_height.to_f
width = (height * output_aspect).round
else
width = (image_info[:width].to_f * 0.90).round # 90% so we don't get borders
Expand Down

0 comments on commit 362f483

Please sign in to comment.