I am generating an html string for an email. I have something that looks like:
<td><img src='whatever.jpg' width='100' style='float:left'/></td>
The problem with this is that while the widths are equal between rows, some rows are super tall or super small depending on the original image size. I would like to have it scale the image to whatever can fit in a 100x100 bounding box, while preserving the aspect ratio. I have tried:
<td><img src='whatever.jpg' width='100' height='100' style='float:left'/></td>
but that destroys the original aspect ratio. I have also tried setting the height of the td element, but that seems to have no effect.
It is not really feasible to load and check the image size when generating the html, as I am not in control of the images and they may change.