Re: Montage script, was Re: [newbie] The Gimp

2002-11-05 Thread Anne Wilson
On Tuesday 05 Nov 2002 1:35 am, you wrote:
 On Mon, 4 Nov 2002 21:07:48 +

 Anne Wilson [EMAIL PROTECTED] wrote:
  I'm definitely interested.  I've got to get these out quickly, so I'll
  be using my old windows program to print the contact sheets, but by next
  weekend I hope to have time to really get to grips with this.  It sounds
  ideal.

 Assuming you have your images in subdirectories containing 20 images each
 (or at least something manageable--I wouldn't go more than 60), this
 script will look at each of those subdirectories and generate a montage.
 The resulting montage uses the name of the folder, so test-1 folder
 produces test-1.jpg. I also like to store my montages in another
 directory, referenced by the variable IndexDir. That and ImageDir--the
 main directory containing all the subdirectories--are really the only
 variables you have to set up.

 Caveats: this does not check to see if the outfile exists--if it does, it
 will write over it. Obviously you're going to have to move the directories
 out of ImageDir, or you will be generating the same montage every time you
 run the script.

 HTH,
 Todd

 #!/bin/bash

 # SET UP VARIABLES

 ImageDir=/home/todd/fuji/keep
 IndexDir=/home/todd/fuji/composites
 EXT=.jpg
 LABEL=`basename %f`
 MYFONT=-monotype-arial-medium-r-normal-*-*-120-*-*-p-*-koi8-ru

 # DONE WITH VARIABLES

 for folder in `find $ImageDir -mindepth 1 -maxdepth 1 -type d`
 do
   echo Folder is `basename $folder`
   OUTFILE=`basename $folder`$EXT
   for i in `find $folder -maxdepth 1 -type f -iname '*.jpg'`
   do
   WIDTH=`identify $i | awk '{print $3}' | awk -F x '{print $1}'`
   HEIGHT=`identify $i | awk '{print $3}' | awk -F x '{print $2}'`
   if [ $HEIGHT -gt $WIDTH ] ; then
   echo -rotate 90 $i -label %f -noop  list.$$
   else
   echo $i -label %f  list.$$
   fi
   done
   montage -geometry 200+2+5 -background white -font $MYFONT -tile 4x5 `cat
 list.$$` $IndexDir/$OUTFILE
   wait
   rm list.$$
 done

 echo Done!
 exit

Thanks Todd.  All printed, copied, and ready for the weekend's work.

Anne


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com



Montage script, was Re: [newbie] The Gimp

2002-11-04 Thread Todd Slater
On Mon, 4 Nov 2002 21:07:48 +
Anne Wilson [EMAIL PROTECTED] wrote:

 I'm definitely interested.  I've got to get these out quickly, so I'll
 be using my old windows program to print the contact sheets, but by next
 weekend I hope to have time to really get to grips with this.  It sounds
 ideal.

Assuming you have your images in subdirectories containing 20 images each
(or at least something manageable--I wouldn't go more than 60), this
script will look at each of those subdirectories and generate a montage.
The resulting montage uses the name of the folder, so test-1 folder
produces test-1.jpg. I also like to store my montages in another
directory, referenced by the variable IndexDir. That and ImageDir--the
main directory containing all the subdirectories--are really the only
variables you have to set up.

Caveats: this does not check to see if the outfile exists--if it does, it
will write over it. Obviously you're going to have to move the directories
out of ImageDir, or you will be generating the same montage every time you
run the script.

HTH,
Todd

#!/bin/bash

# SET UP VARIABLES

ImageDir=/home/todd/fuji/keep
IndexDir=/home/todd/fuji/composites
EXT=.jpg
LABEL=`basename %f`
MYFONT=-monotype-arial-medium-r-normal-*-*-120-*-*-p-*-koi8-ru

# DONE WITH VARIABLES

for folder in `find $ImageDir -mindepth 1 -maxdepth 1 -type d`
do
echo Folder is `basename $folder`
OUTFILE=`basename $folder`$EXT
for i in `find $folder -maxdepth 1 -type f -iname '*.jpg'`
do
WIDTH=`identify $i | awk '{print $3}' | awk -F x '{print $1}'`
HEIGHT=`identify $i | awk '{print $3}' | awk -F x '{print $2}'`
if [ $HEIGHT -gt $WIDTH ] ; then
echo -rotate 90 $i -label %f -noop  list.$$
else
echo $i -label %f  list.$$
fi
done
montage -geometry 200+2+5 -background white -font $MYFONT -tile 4x5 `cat
list.$$` $IndexDir/$OUTFILE
wait
rm list.$$
done

echo Done!
exit




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com