> Ok, before you go responding with percentages, I should note this. > > consider this: > Image1 : 100x100 (Ratio = 1:1) > Image2 : 100x200 (Ratio = 1:2) > > Space available for display : 75x75 > > now, i can say "width=75% height=75%", but this will > only work for Image1, since Image2 will end up > as 75x150 (which clearly does not fit the 75x75 constraints) > > now, if i specify "width=75 height=75", again, this works for Image1, but > not Image2, since the new Image2 ratio will be 1:1, with Image2 losing > 1/2 of it's heigth ratio.
HTML isn't smart enough to figure that out and this is a PHP list, anyhow. Use the image functions to get the height and width of the image. Find out which is larger and determine what percent you need to scale that number down to get to 75 pixels. Now scale the other dimension by the same percentage. Plug both into the <img> tag and be done with this! ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php