tumbnails

Discuss Applications
Post Reply
User avatar
cdhgold
administrator
administrator
Posts: 382
Joined: Tue Mar 18, 2003 6:11 pm
Location: Texas

tumbnails

Post by cdhgold » Tue Apr 20, 2004 9:29 am

can any suggest a app to use to create thumbnails for many images at once for use in a web page? Under windoze i used dreamweaver mx and fireworks MX to create web photo albums just gave it the location of original images and where to save the new files and it created the thumbnails and put them in the web page unfortunalty fireworks which is the componet that did the image maniipulation is the only component of dreamweaver studio mx that does not run under crossover office. I'm looking for a way to do the same thing in linux I know I can use GIMP to reduce the images but want a way to do many images at once and reduce them in size and create thumbnails of them at same time.

Chris

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux » Tue Apr 20, 2004 10:38 am

The convert utility which is part of ImageMagick will do this for you.
Here is a small example script for you to see the usage:

Code: Select all

#!/bin/bash
# thumb.sh by Tux
for file in *.$1
do
convert -size 200x150 "$file" -resize 200x150 tn_"$file"
done
It is evoked as ./thumb.sh with the file extension of the source images following, ie
./thumb.sh jpg

For all .jpg files, but NOT JPG, jpeg, Jpg, jPG etc.
You would have to add that functionality yourself :)

There is probably a decent script or wrapper program to do this already but it's more fun to make your own ;)


-size tells convert the dimentions of the output files, this is not a nessesary option but speeds up processing.
-resize tells convert the required dimentions for the output thumbnails.
Last edited by Tux on Tue Apr 20, 2004 11:07 am, edited 1 time in total.

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Apr 20, 2004 10:56 am

If you have ImageMagick installed (you likely do) then there are many ways:

Now the following way will overwrite the original image so you might not want this:

Code: Select all

$ mogrify -size 120x120 -resize 120x120 +profile "*" *.jpg
More info on mogrify:
http://www.imagemagick.org/www/mogrify.html

To not overwrite the existing image but create thumbnails with a "-t" appended to the name you might use the "convert command (also part of ImageMagick). This will create thumbnails for all *.jpg files in the current directory:

Code: Select all

$ for i in *.jpg; do convert -size 120x120 $i -resize 120x120 +profile "*" ${i%%.jpg}-t.jpg; done
More on convert:
http://www.imagemagick.org/www/convert.html

If you don't have it installed, it should have come with your distro, or if you have apt set up:

# apt-get install ImageMagick

EDIT: Looks like Tux beat me to it. :) I do believe the -size and -resize options should be looked at more closely on the web pages I linked to. I think you want to use the thumbnail size in both, not the image size.

Tux
guru
guru
Posts: 689
Joined: Wed Jan 08, 2003 10:40 am

Post by Tux » Tue Apr 20, 2004 11:08 am

Void Main wrote: EDIT: Looks like Tux beat me to it. :) I do believe the -size and -resize options should be looked at more closely on the web pages I linked to. I think you want to use the thumbnail size in both, not the image size.
Correct, edited my post. that's what I get for posting from memory :)

agent007
administrator
administrator
Posts: 254
Joined: Wed Feb 12, 2003 11:26 pm

Post by agent007 » Tue Apr 20, 2004 12:26 pm

gthumb creates thumnails too...

User avatar
Void Main
Site Admin
Site Admin
Posts: 5716
Joined: Wed Jan 08, 2003 5:24 am
Location: Tuxville, USA
Contact:

Post by Void Main » Tue Apr 20, 2004 5:50 pm

agent007 wrote:gthumb creates thumnails too...
I didn't know that existed. Nice little utility. It can generate static image indexes and thumbnails similar to the PHP based gallery app. Here's some pictures I have in the Void gallery:

http://voidmain.is-a-geek.net/pics/

Post Reply