Eiolon Posted December 13, 2007 Share Posted December 13, 2007 Let's say I want to have a maximum avatar dimensions of 100x100 pixels. That's easy to enforce by specifying the height and width in the image command. What would I need to do in order allow a 75x75 avatar be used by not be stretched to 100x100? Thanks! Currently, I am using: <img src="<?php echo $row_users['avatar'] ?>" height="100" width="100" /> Quote Link to comment Share on other sites More sharing options...
papaface Posted December 13, 2007 Share Posted December 13, 2007 I would use http://uk3.php.net/manual/en/function.getimagesize.php to generate the height and width of the image on the fly. <?php list($width, $height, $type, $attr) = getimagesize($row_users['avatar']); echo '<img src="'.$row_users['avatar'] .'" height="'.$height.'" width="'.$width.'" />'; ?> Quote Link to comment Share on other sites More sharing options...
Eiolon Posted December 13, 2007 Author Share Posted December 13, 2007 Great, thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.