FIX: Don't use auto sizes for very small images (emoticons)

This commit is contained in:
Robin Ward 2014-11-07 16:09:16 -05:00
parent 8199c3b440
commit 5defaca197
2 changed files with 2 additions and 3 deletions

View File

@ -15,7 +15,6 @@ module Email
end end
def html def html
if @message.html_part if @message.html_part
style = Email::Styles.new(@message.html_part.body.to_s) style = Email::Styles.new(@message.html_part.body.to_s)
style.format_basic style.format_basic

View File

@ -37,8 +37,8 @@ module Email
img['height'] = 20 img['height'] = 20
else else
# having no extra style on email images might work best? # having no extra style on email images might work best?
img['width'] = 'auto' img['width'] = 'auto' if img['width'].to_i > 20
img['height'] = 'auto' img['height'] = 'auto' if img['height'].to_i > 20
add_styles(img, 'max-width:100%;') if img['style'] !~ /max-width/ add_styles(img, 'max-width:100%;') if img['style'] !~ /max-width/
end end