Onebox images in email notifications are HUGE


(Dan Dascalescu) #1

The Onebox for this link looks like this in the notification email:

(Régis Hanol) #2

Just reverted a changed made 1 year ago :astonished: by @codinghorror

(Jeff Atwood) #3

I think the reason I made that change is some images were showing up wider than the email. But it definitely should not have applied to onebox images. I suspect this will cause problems since the case cited above is specific to oneboxes, whereas that CSS change was about the whole email. We’ll see…

(Kane York) #4

Looks like what you’re supposed to do for that is:

width: 100%;
max-width: 75px;

(Jeff Atwood) #5

Yeah this has screwed up my email notifications on iPhone with images now look super wide, as they ‘stretch’ to the size of the largest image, like this:

The actual markup is

<img src="image.png" width="auto" height="auto" class="CToWUd">

The line that was incorrectly removed is

add_styles(img, 'max-width:100%;') if img['style'] !~ /max-width/

Since there is no max width, the email will just become super tiny / wide if the embedded image is very wide.

(Régis Hanol) #6

Just pushed a proper fix :cherries:

Onebox-embedded thumbnails don't get resized sometimes for emails
(Régis Hanol) #7