Sign in to follow this  
man2thedeep

[web] Bitmap Thumbnails

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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 :)

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this