Last post May 17, 2005 12:08 PM by Qnnn
May 16, 2005 05:35 PM|em23|LINK
I'm in a bind here. My site allows me to upload and image(mine are 640 px by 480px - 150 KB) onto the server. Then the home page displays a 100 by 75 px version of that image in the datagrid. But the 100 by 75 version is still the FULL 150 KB!! It takes
forever to load! Is there an easy way for me to reduce the file size. I don't even care about quality. Thanks in advance
May 17, 2005 12:08 PM|Qnnn|LINK
If you just set height and width for image in datagrid then image is downloaded as it is (or what else should web server do when image is asked?). Height and width in this case are information for web browser. It doesn't affect server side processes.
Solution. After image is uploaded create thumbnail of it. And when showing list of images use thumbnails you created previously. There are many examples available if you search from google. You may also consider creating thumbnails on the
fly. In this case you should have image URL-s in your datagrid something like thumbnail.aspx?file=filename. Thumbnail.aspx is file that checks if thumbnail exists. If exists then returns it, otherwise creates thumbnail and returns it.
If you have more questions then feel free to ask. [:)]