#!/bin/sh
#
# make_variants: generate different sized versions of images and video frames
#
# usage: make_variants *.jpg *.avi
#
# dependencies:
#     http://impressive.net/software/photo/source/make_variant
#     http://impressive.net/software/photo/source/make_variants_from_video
#
# Gerald Oskoboiny, 27 Nov 2001
#
# source: http://impressive.net/software/photo/source/make_variants
#
# $Id: make_variants,v 1.8 2008/08/18 22:15:10 gerald Exp $
#

for f in "$@"; do
 case $f in
  *-sm.jpg|*-tn.jpg|*-sq.jpg|*.thm)
    # already a variant, do nothing
    # omitting *-med.jpg here in case we need to generate a sq based on a med
  ;;
  *.avi)
    make_variants_from_video $f
  ;;
  *.jpg)
    med=`echo $f | sed 's/\.jpg/-med.jpg/g; s/-med-med\./-med./g'`
    make_variant 480 med $f
    make_variant 100 sq $med
    make_variant 300 sm $med
    make_variant 128 tn $med
  ;;
 esac

done

#
# changelog:
#
# $Log: make_variants,v $
# Revision 1.8  2008/08/18 22:15:10  gerald
# added links to dependencies
#
# Revision 1.7  2007/01/30 09:04:03  gerald
# added support for video files (using make_variants_from_video)
#
# Revision 1.6  2006/11/20 06:49:32  gerald
# fixed bug in optimization to use med sized files
#
# Revision 1.5  2006/10/09 04:41:06  gerald
# speed things up by generating smaller variants based on foo-med.jpg
#
# Revision 1.4  2005/12/09 21:42:08  gerald
# generate 100x100 square-cropped variants named foo-sq.jpg as well;
# stop generating tn and med variants in background
#
# Revision 1.3  2002/08/08 03:58:03  gerald
# added a pointer to the source url
#
# Revision 1.2  2002/04/29 04:54:41  gerald
# added changelog
#
#

