#!/bin/csh -f # scalejpg # ------------------------------------------------------------------------------ # Shell script to read an image file (JPG, PNG, GIF, etc.) and scale it a # JPG of a different size. # ------------------------------------------------------------------------------ # Usage: See Usage section below or run with no arguments to see usage. # Assumptions: # Effects: # - Reads from an image file (JPG, PNG, GIF, etc.) or stdin and writes # to a JPG or stdout. # Notes: # Implementation Notes: # Portability Issues: # Revision History: # $Log$ # ------------------------------------------------------------------------------ if ($#argv == 0 || "$1" == "-h" || "$1" == "--help") then # We need this Usage section (which duplicates the one on the Java file) # only because that one echos a usage line like: # Usage: java -classpath scalejpg.jar;bristle.jar # com.bristle.javaapps.scalejpg.ScaleJPG [options] [infile [outfile]] # instead of the simpler usage line here. echo "Usage: $0:t [options] [infile [outfile]]" echo "Where options can be any of the following:" echo " -percent percent" echo " Scales to specified percent (1-100)." echo " -width width" echo " Scales to specified width, preserving aspect ratio." echo " -height height" echo " Scales to specified height, preserving aspect ratio." echo " -width width -height height" echo " Scales to specified width and height exactly." echo " -width width -height height -fit" echo " Scales to largest size that will fit in both the" echo " specified width and height, preserving aspect ratio." echo " -algorithm fast" echo " Uses a fast algorithm for scaling." echo " -algorithm smooth" echo " Uses a smooth algorithm for scaling." exit 1 endif java -Xmx1G -classpath /Users/fred/fred/lib/scalejpg.jar:/Users/fred/fred/lib/bristle.jar com.bristle.javaapps.scalejpg.ScaleJPG $*:q