#!/usr/local/bin/perl -w # # make_meds: create medium-sized versions of each image named in @ARGV # # Gerald Oskoboiny, 7 Feb 1999 # # $Id: make_meds,v 1.1 2002/04/29 05:31:44 gerald Exp $ $thumb_suffix = "-med"; $border_size = 4; $total_height = 480; $thumb_height = $total_height - ( 2 * $border_size ); $convert = "convert"; $convert_opts = "-bordercolor '#000' -border ${border_size}x${border_size} -dither "; foreach $file (@ARGV) { if ( ! -r $file ) { print STDERR "Can't read $file! skipping it...\n"; next; } $thumb_name = $file; $thumb_name =~ s/\./${thumb_suffix}./; if ( -f $thumb_name ) { print STDERR "Thumbnail $thumb_name already exists! skipping it...\n"; next; } system "$convert -geometry x$thumb_height $convert_opts $file $thumb_name"; print "Done $file\n"; } exit;