[Gllug] perl script

Philippe Rousselot linux at rousselot.org
Thu Aug 22 08:23:28 UTC 2002


Here is the final script

I start with
mm_aa_xx_yy.jpg at 2720dpi

and I get

aa_mm_xx_yy.jpeg still 2720dpi

and

aa_mm_xx_yy_petit.jpeg with 720x480 resolution

~~~~~~~~~~~~
#!/bin/bash
for i in *jpg
     do
     #rename files by changing extension from jpg to jpeg
     cp --preserve "$i" `basename $i jpg`jpeg;

     # remove old file
     rm "$i" ;

     done

for j in *jpeg
     do

     #invert month and year
     new=$(echo $j|sed -e \
     's#^\(.\)\(.\)\(.\)\(.\)\(.\)\(.*\)#\4\5\3\1\2\6#');
     mv $j $new;

     #creates thumnails
     convert -size 720x480 "$new" -geometry 720x480 `basename $new 
.jpeg`_petit.jpeg;

     done
~~~~~~~~~~~~

thanks for your help

Philippe



-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list