Version 0 of Web pages with images

Updated 2003-04-17 17:06:55

Theo Verelst

Today I was making pictures available on a tclhttpd server, and wanted to make a few hundred automatically sized, compressed (progressive), listed per 10 on a web page as little images with can be clicked on to expand.

The result: http://195.241.128.75/Pictures3/list1.html

I used the cygnus supplied, though seperately downloadable, check some search engine, cjpeg/djpeg routines, and used a tcl script to use them on lists of image files:

 set j DSC00155b1m ; 
 eval "exec /bin/djpeg -scale 1/1 $j.jpg |   /bin/cjpeg.exe  -quality 18 -progressive -outfile $j\_c.jpg"

The djpeg decompresses the source jpeg file, pipe-s it through to cjpeg , which reencodes it with quality 18, which is pretty compressed to another file. These tools are quite high quality, and make compact encoded images look relatively good.

The final commands where like this, to make a small and full scale both quite compressed image set per input image:

 set inp $path_to_source_images
 set outp $path_to_destination_images

 foreach i [glob $inp/*.jpg] {set j [file tail [file rootname $i]] ; eval "exec /bin/djpeg -scale 1/4 $inp/$j.jpg |   /bin/cjpeg.exe  -quality 15 -progressive -outfile $outp/$j\_cs.jpg"}

 foreach i [glob $inp/*.jpg] {set j [file tail [file rootname $i]] ; eval "exec /bin/djpeg -scale 1/1 $inp/$j.jpg |   /bin/cjpeg.exe  -quality 25 -progressive -outfile $outp/$j\_cn.jpg"}

Automatically, all .jpg images in the source dir will be encoded in 1/4 size and full size in the dest directory, both with progressive encoding, allowing a browser to start dislaying a course impression of the image as soon as a little of the data has been downloaded.