mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-03-23 05:15:45 -04:00
only auto scale email img if both dims large
This commit is contained in:
parent
11ae3caeff
commit
855305b0f6
1 changed files with 4 additions and 2 deletions
|
@ -38,8 +38,10 @@ module Email
|
|||
img['height'] = 20
|
||||
else
|
||||
# having no extra style on email images might work best?
|
||||
img['width'] = 'auto' if img['width'].to_i > 250
|
||||
img['height'] = 'auto' if img['height'].to_i > 250
|
||||
if img['width'].to_i > 250 and img['height'].to_i > 250
|
||||
img['width'] = 'auto'
|
||||
img['height'] = 'auto'
|
||||
end
|
||||
add_styles(img, 'max-width:100%;') if img['style'] !~ /max-width/
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue