Whenever I display an image, it looks distorted. What is the proper way to display an image? My Site And I notice a lot of sites out there have a white border around their images. How do they do that? example site
You never adjust the size of an image using the width and height attributes. You must do the adjusting using an image editor (make sure to keep a master copy). The width and height attributes are used only to specify the width and height of the image to browsers.
You can use the width and height tags but it will take alot of trial and error to get it to look just right. Using an image editor will make the job much easier .
CSS. Just add something like this to your img style: border:solid 1px #333333; padding:1px; Code (markup): You can dynamically create resized versions of user uploaded images by using the PHP GD Library: http://www.php.net/manual/en/intro.image.php http://www.lateralcode.com/manipulating-images-using-the-php-gd-library/ http://www.libgd.org/Main_Page It sounds way more complicated than it is.
use any php script to resize the image of your desired size. Make sure you maintain aspect ratio. If not it would get distorted.
Do I need to create the image thumbnail and save it in a directory, or do most people just generate the display image as a thumbnail on the fly?
the best method is save it on your server and then display it. if you do it on the fly, it will put load on your server cpu usage. i always use php thumbnailer class to get the job done..