Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Wednesday, October 14, 2026

Diff for scripts/shell/photo-managment/foto-copy between version 1.4 and 1.5

version 1.4, 2009/08/05 19:46:51 version 1.5, 2011/03/01 22:31:31
Line 25 
Line 25 
 # 2006-08-14 - enhanced - images are auto-rotated - Exif tag Exif.Image.Orientation is used  # 2006-08-14 - enhanced - images are auto-rotated - Exif tag Exif.Image.Orientation is used
 #  #
   
 # $Platon: scripts/shell/photo-managment/foto-copy,v 1.3 2009-01-12 23:17:07 rajo Exp $  # $Platon: scripts/shell/photo-managment/foto-copy,v 1.4 2009-08-05 19:46:51 rajo Exp $
   
 # where to mount you memory card - configure in /etc/fstab something like this:  # where to mount you memory card - configure in /etc/fstab something like this:
 # /dev/sdb1     /foto           vfat    iocharset=iso8859-2,umask=002,codepage=852,showexec,users,gid=users,noauto,nodev,nosuid,quiet 0 0  # /dev/sdb1     /foto           vfat    iocharset=iso8859-2,umask=002,codepage=852,showexec,users,gid=users,noauto,nodev,nosuid,quiet 0 0
 MOUNTPOINT="/foto"  MOUNTPOINT="/foto"
 #MOUNTPOINT="/foto2"  
 #MOUNTPOINT="/foto3"  
 # where to copy your photos for sorting - /home/rajo/media/foto/2006/  # where to copy your photos for sorting - /home/rajo/media/foto/2006/
 DEST="$HOME/media/foto/`date +%Y`"  DEST="$HOME/media/foto/`date +%Y`"
 # wildcard names of your original photos  # wildcard names of your original photos
 RENAME_FILES="pict*.jpg img_*.jpg IMG_*.JPG dsf*.jpg DSC*.JPG dsc*.jpg"  RENAME_FILES="PICT*.JPG pict*.jpg img_*.jpg IMG_*.JPG dsf*.jpg DSC*.JPG dsc*.jpg"
 # howto rename your files: img_1234.jpg --> 2006-08-13_230001_img_1234.jpg (image taken on  2006-08-13 23:00:01)  # howto rename your files: img_1234.jpg --> 2006-08-13_230001_img_1234.jpg (image taken on  2006-08-13 23:00:01)
 JHEAD_OPTS="-n%Y-%m-%d_%H%M%S_%f"  JHEAD_OPTS="-n%Y-%m-%d_%H%M%S_%f"
   
Line 97  rotate_jpeg()
Line 95  rotate_jpeg()
 grep -q $MOUNTPOINT /etc/mtab  grep -q $MOUNTPOINT /etc/mtab
 if [ $? = 1 ]; then  if [ $? = 1 ]; then
         echo "Mounting $MOUNTPOINT"          echo "Mounting $MOUNTPOINT"
         mount $MOUNTPOINT          available_devs=`awk "\\$2 == \"$MOUNTPOINT\" { print \\\$1; }" /etc/fstab`
           if [ -z "$available_devs" ]; then
                   echo "ERROR: mountpoint '$MOUNTPOINT' not found in /etc/fstab"
                   exit 1;
           fi
           for dev in $available_devs; do
                   if [ -e $dev ]; then
                           echo "Mounting '$dev'"
                           mount $dev
                           break;
                   fi
           done
           #mount $MOUNTPOINT
         make_umount="yes"          make_umount="yes"
 fi  fi
   
Line 127  fi
Line 137  fi
 # now rotate and rename your JPEG files from your CF card  # now rotate and rename your JPEG files from your CF card
 for ren in $RENAME_FILES; do  for ren in $RENAME_FILES; do
         rotate_jpeg $DEST/$ren          rotate_jpeg $DEST/$ren
         $JHEAD $JHEAD_OPTS $DEST/$ren          $JHEAD $JHEAD_OPTS $DEST/$ren | while read jpg arrow newjpg; do
                   mv ${jpg%.jpg}.CR2 ${newjpg%.jpg}.CR2
           done
 done  done
   
 # if we are not on battery, do CPU expensive job - decode RAW files to JPEG,  # if we are not on battery, do CPU expensive job - decode RAW files to JPEG,
Line 142  fi
Line 154  fi
   
 # decode raw files - CPU expensive job...  # decode raw files - CPU expensive job...
 echo "Decoding RAW files..."  echo "Decoding RAW files..."
 for i in *.crw *.cr2; do # {{{  for i in img_*.crw img_*.cr2 IMG_*.CRW IMG_*.CR2; do # {{{
         [ "x$i" = "x*.crw" ] && continue          [ "x$i" = "ximg_*.crw" ] && continue
         [ "x$i" = "x*.cr2" ] && continue          [ "x$i" = "ximg_*.cr2" ] && continue
           [ "x$i" = "xIMG_*.CRW" ] && continue
           [ "x$i" = "xIMG_*.CR2" ] && continue
         file=${i%.crw}          file=${i%.crw}
         file=${file%.cr2}          file=${file%.cr2}
           file=${file%.CRW}
           file=${file%.CR2}
         if [ ! -f "$file.jpg" ]; then          if [ ! -f "$file.jpg" ]; then
                 echo --- $i;                  echo --- $i;
                 $DCRAW -w $i # use white ballance set by camera                  $DCRAW -w $i # use white ballance set by camera
Line 189  for i in *.crw *.cr2; do # {{{
Line 205  for i in *.crw *.cr2; do # {{{
         rm -f $file.exv          rm -f $file.exv
         rm -f $file.cmd          rm -f $file.cmd
   
           # rename decoded *.jpg and RAW file too
           $JHEAD $JHEAD_OPTS $file.jpg | while read jpg arrow newjpg; do
                   mv ${jpg%.jpg}.CR2 ${newjpg%.jpg}.CR2
           done
   
         if [ -d "$DEST/raw" ]; then          if [ -d "$DEST/raw" ]; then
                 echo "Moving $i $file.thm to $DEST/raw"                  echo "Moving $i $file.thm to $DEST/raw"
                 mv $i $file.thm $DEST/raw/ && $JHEAD $JHEAD_OPTS $file.jpg                  mv $i $file.thm $DEST/raw/ && $JHEAD $JHEAD_OPTS $file.jpg

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top