| version 1.5, 2011/03/01 22:31:31 |
version 1.6, 2011/03/21 20:56:18 |
|
|
| # 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.4 2009-08-05 19:46:51 rajo Exp $ |
# $Platon: scripts/shell/photo-managment/foto-copy,v 1.5 2011-03-01 22:31:31 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 |
| Line 152 if [ "x$on_bat" = "xdischarging," ]; the |
|
| Line 152 if [ "x$on_bat" = "xdischarging," ]; the |
|
| fi |
fi |
| fi |
fi |
| |
|
| |
find $DEST -maxdepth 1 -type f \( -name '*.CTG' -o -name '*.ctg' \) -ls -delete |
| |
|
| # decode raw files - CPU expensive job... |
# decode raw files - CPU expensive job... |
| echo "Decoding RAW files..." |
echo "Decoding RAW files..." |
| for i in img_*.crw img_*.cr2 IMG_*.CRW IMG_*.CR2; do # {{{ |
for i in img_*.crw img_*.cr2 IMG_*.CRW CRW_*.CRW IMG_*.CR2; do # {{{ |
| [ "x$i" = "ximg_*.crw" ] && continue |
[ "x$i" = "ximg_*.crw" ] && continue |
| [ "x$i" = "ximg_*.cr2" ] && continue |
[ "x$i" = "ximg_*.cr2" ] && continue |
| [ "x$i" = "xIMG_*.CRW" ] && continue |
[ "x$i" = "xIMG_*.CRW" ] && continue |
| |
[ "x$i" = "xCRW_*.CRW" ] && continue |
| [ "x$i" = "xIMG_*.CR2" ] && continue |
[ "x$i" = "xIMG_*.CR2" ] && continue |
| file=${i%.crw} |
|
| file=${file%.cr2} |
small_i="`echo $i | tr '[A-Z]' '[a-z]'`" |
| file=${file%.CRW} |
if [ "x$i" != "x$small_i" ]; then |
| file=${file%.CR2} |
mv "$i" "$small_i"; |
| |
# convert *.THM file to lowercase |
| |
t="${i%.CRW}.THM" |
| |
if [ -f "$t" ]; then |
| |
small_t="`echo $t | tr '[A-Z]' '[a-z]'`" |
| |
mv "$t" "$small_t" |
| |
fi |
| |
fi |
| |
# file has been renamed to lowercase, change variable |
| |
i="$small_i" |
| |
|
| |
ext="${i#*\.}" |
| |
file="${i%.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 207 for i in img_*.crw img_*.cr2 IMG_*.CRW I |
|
| Line 224 for i in img_*.crw img_*.cr2 IMG_*.CRW I |
|
| |
|
| # rename decoded *.jpg and RAW file too |
# rename decoded *.jpg and RAW file too |
| $JHEAD $JHEAD_OPTS $file.jpg | while read jpg arrow newjpg; do |
$JHEAD $JHEAD_OPTS $file.jpg | while read jpg arrow newjpg; do |
| mv ${jpg%.jpg}.CR2 ${newjpg%.jpg}.CR2 |
mv "${jpg%.jpg}.$ext" "${newjpg%.jpg}.$ext" |
| |
t="${jpg%.jpg}.thm" |
| |
[ -f "$t" ] && mv "$t" "${newjpg%.jpg}.thm" |
| done |
done |
| |
|
| if [ -d "$DEST/raw" ]; then |
|
| echo "Moving $i $file.thm to $DEST/raw" |
|
| mv $i $file.thm $DEST/raw/ && $JHEAD $JHEAD_OPTS $file.jpg |
|
| ln -s $DEST/raw/$file.thm $DEST/raw/$file-thumb.jpg |
|
| fi |
|
| done # }}} |
done # }}} |
| |
|
| #echo "Removing unused *.thm files" |
#echo "Removing unused *.thm files" |