Code: Select all
<img src="<?php echo $pic; ?>" height="50%">For whatever reason, the height="%" attribute alone resizes the pic proportionally. No matter the original pic size, it either increases or decreases it to a standard size that I can control by the % value. At about 50%, I get a pic in the ballpark of 300px by 300px (depending on the original dimensions of the pic). 15% gives me about an avatar sized pic and so on. It seems to have an even greater effect inside of a table. To get a picture inside of a table to roughly 300px by 300px, I had to increase the % value by quite a bit.
I tested this on 50 different browser/platform combos and it worked just fine on about 90% of them. Only 4 or 5 of them either didn't display the pic at all or didn't resize them. I haven't looked into why yet. I'm too tired right now.
Anyway, does anyone know what I'm actually doing here? It seems too simple compared to all of the code I've seen on how to resize pics. I can't help but to think a major issue will eventually spring up on me.