Genethumb.sh

generated by genethumb.sh version 0.1.1_ness

Welcome! This is my derivitive of a great little shell script called genethumb.sh. I have extended it's capabilites to allow the user to generate scaled pictures during the thumbnail creation process.

The Problem

When you download your pictures to a directory from your digital camera often the photos come in very large sizes like 2160x1440. Which is great because you may want some high resolution photos for editing later, but these sizes are very "screen-unfriendly" and difficult to view because you have to use the scrollbars in your web broswer to view the entire picture.

What I've done

Now you can resize your photos to a managable 640x480 size with a simple flag -r to genethumb.sh. But it would be a shame to lose your high resolution photos, you may want to print these later or edit the photos again, so there is another flag -b that allows you to back up the original files in the directory before resizing occurs.

The options for genethumb.sh 0.1.1_ness are available by the -h flag.

[nesscg@sketchy testing]$ genethumb.sh -h
Usage: /home/nesscg/bin/genethumb.sh [-c num_columns] [-b] [-e]
                 [-r [-x width] [-y height] ]
  -b  = Backup files to ./backup
  -r  = Resize images (Default size is 640x480)
  -x  = Resize width value in pixles to use
  -y  = Resize height value in pixles to use
  -c  = Number of pictures per column
  -s  = Repress size of pictures being printed
  -n  = Repress name of pictures being printed
  -e  = Clean up files created by a previous run (but not backups)

Download The Bash Script

This script is dependant on a version of ImageMagick as it requires the programs convert and identify.

The Original 0.0.8

This program was based on Sam Zoy's genethumb.sh and I have not changed very much. Simply added a few features.
Complete documentation of the original script can be found on Sam's genethumb.sh page.

Perhaps the best excerpt is for the recursive directory generation of thumbnails. This is something that I plan to put in the 0.1.0 release. The text reads:

 for dir in `find -type d -name '.xvpics' -prune -o -print`; do ( cd "$dir" && genethumb.sh ) ; done

ChangeLog

# genethumb.sh - Génération de thumbnails mortels de ta mère
# (c)  3 Jan 1998: version 0.0.4 by Samuel Hocevar 
#     22 May 2000: version 0.0.5 by Samuel Hocevar 
#     15 Nov 2000: version 0.0.6 by Samuel Hocevar 
#                    with code from Sven Hartge 
#     13 Dec 2000: version 0.0.7 by Samuel Hocevar 
#                    now compatible with old ImageMagick versions
#                    added --rows option
#     27 Apr 2003: version 0.0.8 by Sam Hocevar 
#                    removed all bashisms
#                    now compatible with all ImageMagick versions
#     19 Jun 2003: version 0.0.9 by Chris Ness 
#                    better command line option parsing
#                    able to resize final photos (default 640x480)
#      5 May 2005: version 0.1.0 by Chris Ness 
#                    handles videos and makes a jump link to them (avi,mpg)
#                    only uses the basename of the directory for a title
#                    no longer prints help message with normal use
#      8 May 2005: version 0.1.1 by Chris ness 
#                    added *.mov as a video extension
#                    new dependency on `wc` (word count) for videos
#                    I didn't know bash wouldn't let you set a var that is
#                      outside a while loop when you are inside it.  Weird!

Chris Ness
nesscg at mcmaster dot ca