diff --git a/app/helpers/commonwealth_vlr_engine/collections_helper_behavior.rb b/app/helpers/commonwealth_vlr_engine/collections_helper_behavior.rb index a2bcc5dd..d8dab5ea 100644 --- a/app/helpers/commonwealth_vlr_engine/collections_helper_behavior.rb +++ b/app/helpers/commonwealth_vlr_engine/collections_helper_behavior.rb @@ -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