Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Return default aspect ratio when it’s 0
Browse files Browse the repository at this point in the history
  • Loading branch information
reefdog committed Nov 15, 2016
1 parent bd551c5 commit 2a47d5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/page.rb
Expand Up @@ -155,7 +155,7 @@ def title_lower
# up a document process action to calculate the ratios and temporarily return
# the most common size, 8.5x11.
def safe_aspect_ratio
aspect_ratio || (document.calculate_aspect_ratios && 8.5/11)
(aspect_ratio.to_f > 0 && aspect_ratio) || (document.calculate_aspect_ratios && 8.5/11)
end

# Normal aspect ratio is `width / height`, but for the purposes of the
Expand Down

0 comments on commit 2a47d5f

Please sign in to comment.