mirror of
https://github.com/discourse/discourse.git
synced 2025-03-21 18:37:56 +08:00
only auto scale email img if both dims large
This commit is contained in:
parent
11ae3caeff
commit
855305b0f6
@ -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…
x
Reference in New Issue
Block a user