#!/usr/bin/perl -w #2008-03 http://kimbriggs.com/computers/ # #For original photos that are 2304x1728 pixels. Change percentages accordingly. # #Reduces all *.jpg photos 27.8% in current directory puts tagline on it #Creates thumbnails with same name at 8.33% in subdirectory "thumbs" #These sizes are for the "4 megapixel - fine" setting on Fuji F440. #Create a directory for the thumbnails. `mkdir thumbs`; #Load all jpgs into an array. Remove trailing line feed. @pix = `ls -1 *.jpg`; foreach $pix (@pix) { chomp $pix; #Make the thumbnail in the thumbs directory `convert -sample 8.333%x8.333% $pix thumbs/$pix`; #Resize by percent because should be rotated already `convert -sample 27.78%x27.78% $pix $pix`; #Annotate the image with a web address. Upper left always works. `convert -fill black -draw 'roundRectangle 10,10 213,32 5,5' $pix $pix`; `convert -font Helvetica -fill white -pointsize 20 -draw 'text 15,27 "YOUR_BIG_TAG"' $pix $pix`; #Identify is returning a new line AND carriage return (or somethin), so chomp and chop #Latest version does not have need for chop #Print this out to have something to watch. $width = `identify -format "%w" $pix`; chomp $width; $height = `identify -format "%h" $pix`; chomp $height; print "Photo size is ", $width, " by ", $height, " pixels.\n"; } ################################################################ #Abbreviated script to only put marker in upper left of pictures #Load all jpgs into an array. Remove trailing line feed. @pix = `ls -1 ./thumbs/*.jpg`; foreach $pix (@pix) { chomp $pix; #Annotate the image with a web address. Upper left always works. `convert -fill white -draw 'roundRectangle 1,1 124,12 3,1' $pix $pix`; `convert -font Helvetica -fill black -pointsize 12 -draw 'text 3,10 "YOUR_LITTLE_TAG"' $pix $pix`; #Identify is returning a new line AND carriage return (or somethin), so chomp and chop #Latest version does not have need for chop #Print this out to have something to watch. $width = `identify -format "%w" $pix`; chomp $width; $height = `identify -format "%h" $pix`; chomp $height; print "Photo size is ", $width, " by ", $height, " pixels.\n"; }