|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
If I had a lot of 800X600 images and I wanted to make thumbnails for all of them is there an easier way of doing this without having to create thumbnails with a graphics program. Can I code this?
|
|
#2
|
|||
|
|||
|
Depends on the platform you are using. If you are on a version of Unix (like FreeBSD or Linux) you could use xv (Visual Schnauzer builds thumbnails automatically), and you could easily use a little shell script to call "convert" (part of ImageMagick) to build them.
|
|
#3
|
|||
|
|||
|
IrfanView (freeware) also has a nice thumbnail creator. Look for it on www.nonags. com, www.tucows.com, or your favourite freeware site.
|
|
#4
|
|||
|
|||
|
On linux (RH5 ish +).
Maybe this is the script dmahoney refers... for FILE in `ls *.jpg` do convert -geom 20% $FILE tmb_$FILE done will give you an 20% image of each *jpg file in the directory that you run the script. James |
|
#5
|
|||
|
|||
|
well we are sticking to straight dhtml, html, or java if anyone can help me out with that. I have found something which does automatic thumbnails but its not to clean. I like the linux script, its smart. There has to be a way to do it with java like that?
|
|
#6
|
|||
|
|||
|
I happened upon this discussion group while doing a web search for automatic thumbnail viewers this morning. One of the replies above hinted at using xv which got me to looking at the xv docs. Turns out the xv ships with djpeg for doing command line conversions, so I hacked up this quick and dirty script. In my case, I have a Kodak DC280 camera which saves all the files with a .JPG extension. The script grabs all these files, creates thumbnails, and builds an index.html with all the thumbnails as links to their bigger version. Not clean code by any means, but it does the job for me. Hope this message board preserves newlines, or this script is gonna look pretty ugly. :-)
#!/bin/sh # # Take all the *.JPG images and create a thumbnail version and build # a web page index. This program uses "djpeg" which comes with xv # # Also, scale the original pictures so they'll fit in the browser # window nicely. if test -e index.html then echo echo index.html already exists....exiting... echo exit fi echo echo creating index.html of thumbnail images echo echo "<HEAD>" > index.html echo "<TITLE> Images </TITLE>" >> index.html echo "<BODY>" >> index.html # # Assume all the images from the camera are name *.JPG # for fl in `ls *.JPG |grep -v '.thumb.gif'` do newname=`echo $fl |sed -e 's/.JPG$/.thumb.gif/'` rm -f $newname echo creating $newname echo '<img src="' $fl '" width="100%">' > $fl.html /usr/bin/djpeg -colors 16 -scale 1/50 -gif $fl > $newname echo '<A HREF="' $fl.html '"><img src="' $newname '"></A>' >> index.html done echo "</BODY>" >> index.html |
|
#7
|
||||
|
||||
|
Have to ask - cos this is out of my territory- but how do file sizes work out using linux/unix etc - ie: do you get the smallest possible file sizes?
If you have a lot of thumbnails to display this is an important point. I use Fireworks , put all your images in one directory and two mouse clicks later you have another directory full of well formed very small thumbnails - its pretty easy and quick. I only use fireworks for the final compression of my images but it does it so well it was worth the money. ------------------ Simon Wheeler FirePages -DHTML/PHP/MySQL |
|
#8
|
|||
|
|||
|
I use Macromedia Fireworks as well. It does compression quite well.
Spookster ------------------ Visit the WSAbstract Help Forum for your Javascript, DHTML, or General Web Design Questions |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Automatic Thumbnails |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|