Better rending of image thumbnails in HTML. What is the best proceedings in creating thumbnails?
When I create thumbnails in HTML, I see that browser when reduce size of image doesn't use any interpolation. Resiz开发者_如何学JAVAed image looks bed. Could I proceed to browser using interpolation or better rending?
Which of this proceedings is better:
- create thumbnails on server side (eventually holding thumbnails in database, although it takes a lot of space),
- create thumbnails on client side?
Storage is dirt cheap this days, you better off making the thumbnails once in the server and keep them in the file system. No need to store thumbnails in database.
Sample of storing same image in different sizes
Img/big/me.jpg
Img/med/me.jpg
Img/small/me.jpg
Img/icon/me.jpg
You want to create thumbnails on the server side. Transmitting the full-sized image over the internet is much more expensive than storing an additional, tiny file on the server side. Consider the size of the files -- and the cost of bandwidth versus the cost of disk space.
Depending on which server-side language you're using, there are a ton of options for server-side generation. In Python, for example, the Python Imaging Library has proven adequate for my needs. Most languages have ImageMagick libraries, as well.
精彩评论