[web] Bitmap Thumbnails

Started by
3 comments, last by ID Merlin 15 years, 8 months ago
I'm having a problem with bitmap thumbnails. I know there are supposed to be two ways to display thumbnails: 1. create a small image for each image 2. just display the full image but with modified height,width attributes I prefer this 2nd method because it doesn't require any overhead. PROBLEM: When I do this second method the user's browser still downloads the full images which is sucking up major bandwidth. Here is my code: It's still taking as long to load the image as if it was in its original 640x480 format. How do I fix this without having to manually create a thumbnail for each image?
Advertisement
Create a php script that does it for you, and if processing power is an issue, save the resized file in some kind of cache folder or something like that.

[edit] Also, BMP files for the web!? you should probably go with high-quality JPEGs or PNGs if lossless quality is REALLY necessary...
Uhm.. that does what for me? Sorry I'm kind of new to PHP developement.
Resizes the image and outputs it for the user viewing it.

Search on google for help on handling images with PHP. You can do lots of nice stuff with it :)
Bitmap files are peculiar to Windows, so Linux and Macs may have problems with them. They are also uncompressed, so will definitely suck-up your bandwidth. PNG, GIF and JPEG files all use compression, so you'd get a real benefit if you use one of those formats.

As Kamikaze15 pointed out, Google is your friend. You'll find lots of examples of PHP code that will generate thumbs for you.

This topic is closed to new replies.

Advertisement