Skip to content

Commit

Permalink
debug image size
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Jul 14, 2018
1 parent 053c42b commit eaf8068
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/html2doc/mime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ def self.image_resize(i, maxheight, maxwidth)
s = realSize if s[0].zero? && s[1].zero?
s[1] = s[0] * realSize[1] / realSize[0] if s[1].zero? && !s[0].zero?
s[0] = s[1] * realSize[0] / realSize[1] if s[0].zero? && !s[1].zero?
s = [(s[1] * maxheight / s[0]).ceil, maxheight] if s[1] > maxheight
s = [maxwidth, (s[0] * maxwidth / s[1]).ceil] if s[0] > maxwidth
s = [(s[0] * maxheight / s[1]).ceil, maxheight] if s[1] > maxheight
s = [maxwidth, (s[1] * maxwidth / s[0]).ceil] if s[0] > maxwidth
s
end

Expand Down

0 comments on commit eaf8068

Please sign in to comment.