Click to See Complete Forum and Search --> : create small images


Zcumbag
11-18-2003, 12:11 PM
Is there anyway that i can use javascript (or anything else) to create smaller (thumbnail) images of existing images.

It is suposeed to be used for viewing a small thumbnail and get enlarged when you click it... but do I have to make a smaller version of every picture (in say Photoshop) that i want to upload to my website?

do i make sence...?

any ideas, links?

Thanks /David

gil davis
11-18-2003, 12:16 PM
You can control the size of an image by changing the values of the height and width of the image. You can even do it in the HTML. However, the browser still loads the whole file, and that means bandwidth and longer download times. So be nice to your viewer and create the thumbs. Remember, when you hog bandwidth with lots of big images, you affect everyone accessing the server.

Zcumbag
11-18-2003, 12:53 PM
so there's no way that javascript can create that thumbnail?

If I upload the large image (through say a php-page using ftp or whatever) to my website, theres no way javascript can create other smaller image (before the actual upload) so i upload two images... the large one and a smaller one?

gil davis
11-18-2003, 01:00 PM
Originally posted by Zcumbag
so i upload two images... the large one and a smaller one?Yes. That is my suggestion.

Zcumbag
11-18-2003, 01:05 PM
sorry... i think you misunderstood :)

can i with javascript create a smaller version of a picture and save it?

kinda like this:

MyPicture.jpg = 100 kb
MyPicture_thumbnail.jpg = 10kb

or do i have to do it in photoshop?

sorry I didnt make myself understood...

gil davis
11-18-2003, 01:11 PM
Do it in Photoshop.