Onebox images are horizontally squeezed in email notifications

(Michael Downey) #1



(Sam Saffron) #2

@zogstrip I noticed something similar in the mobile view for GitHub oneboxes

(Jeff Atwood) #3

Should be temporary, I was testing some image settings in email, you saw the previous iteration of this. As of right now all non avatar email images are set to height auto width auto.

(Dean Taylor) #4

It seems relevent to post this here:

Just received an email notification, image size looks incorrect in GMail on Android

(Jeff Atwood) #5

This should fix that

if img['width'].to_i > 250 and img['height'].to_i > 250
    img['width'] = 'auto'
    img['height'] = 'auto'

(before, it was testing either of those dimensions and setting to auto if either hit the threshold. Now both image and width must be large enough to trigger)

(Kane York) #6

Won’t that break on a 1x1000px image?

It should set both to auto if either hit the threshold. Before, it was setting just the larger dimension to auto.

(Jeff Atwood) #7

ah good point, I changed it to

if img['width'].to_i > 320 or img['height'].to_i > 480

using the original iPhone screen size as a baseline for auto-sizing… presumably devices are all bigger screen than this now, either scaled or real.

(Jeff Atwood) #8