| version 1.1, 2006/10/02 00:28:11 |
version 1.2, 2009/01/11 16:19:49 |
|
|
| # 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$ |
# $Platon: scripts/shell/photo-managment/foto-copy,v 1.1 2006-10-02 00:28:11 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" |
RENAME_FILES="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" |
| |
|
|
|
| PPMTOJPEG="ppmtojpeg" |
PPMTOJPEG="ppmtojpeg" |
| ACPI="acpi" |
ACPI="acpi" |
| |
|
| |
if [ ! -d $DEST ]; then |
| |
mkdir -p $DEST; |
| |
fi |
| cd $DEST |
cd $DEST |
| |
|
| # lossless rotation of JPEG files |
# lossless rotation of JPEG files |
|
|
| |
|
| # decode raw files - CPU expensive job... |
# decode raw files - CPU expensive job... |
| echo "Decoding RAW files..." |
echo "Decoding RAW files..." |
| for i in *.crw; do # {{{ |
for i in *.crw *.cr2; do # {{{ |
| [ "x$i" = "x*.crw" ] && continue |
[ "x$i" = "x*.crw" ] && continue |
| |
[ "x$i" = "x*.cr2" ] && continue |
| file=${i%.crw} |
file=${i%.crw} |
| |
file=${file%.cr2} |
| if [ ! -f "$file.jpg" ]; then |
if [ ! -f "$file.jpg" ]; then |
| echo --- $i; |
echo --- $i; |
| $DCRAW $i |
$DCRAW $i |
| $PPMTOJPEG $file.ppm > $file.jpg |
$PPMTOJPEG $file.ppm > $file.jpg && rm -f $file.ppm ; |
| rm -f $file.ppm ; |
|
| fi |
fi |
| |
|
| # set EXIF information: |
# set EXIF information: |
| rm -f $file.exv $file-thumb.jpg |
rm -f $file.exv $file-thumb.jpg |
| $EXIV2 ex $i |
$EXIV2 ex $i |
| ln -s $file.thm $file-thumb.jpg |
[ -f $file.thm ] && ln -s $file.thm $file-thumb.jpg |
| |
|
| # doesn't work correctly |
# doesn't work correctly |
| #$EXIV2 -it $file.thm $file.jpg |
#$EXIV2 -it $file.thm $file.jpg |
| Line 158 for i in *.crw; do # {{{ |
|
| Line 164 for i in *.crw; do # {{{ |
|
| if [ -f "$file.thm" ]; then |
if [ -f "$file.thm" ]; then |
| $EXIV2 -P kyv $file.thm | awk 'NF > 2 { print; }' | sed 's/^/set /g;' > $file.cmd |
$EXIV2 -P kyv $file.thm | awk 'NF > 2 { print; }' | sed 's/^/set /g;' > $file.cmd |
| else |
else |
| $EXIV2 -P kyv $file.crw | awk 'NF > 2 { print; }' | sed 's/^/set /g;' > $file.cmd |
$EXIV2 -P kyv $i | awk 'NF > 2 { print; }' | sed 's/^/set /g;' > $file.cmd |
| fi |
fi |
| $EXIV2 -m $file.cmd $file.jpg |
$EXIV2 -m $file.cmd $file.jpg |
| |
|