Goophy:
OK, men gidder du kanskje å utdype det med shell-scriptet litt? Jeg er ganske ny når det gjelder slikt, har kjørt Linux i 2-3uker...
Jeg ser for meg at det kanskje er enklere å bruke et script, da det sikkert er raskere siden det bare skal utføre en oppgave?
Jeg googlet og fant dette;
Kode
#!/bin/sh
#
# Håvard Berland
# http://www.math.ntnu.no/~berland
#
# -----------------------------------------------------------------------
# slightly modified by betso
# for FreeBSD (neftags2jpg does not compile on FreeBSD,
# so use cpexif here which compiles like a charm :)
# to run with sh (bash is not default in *BSD!).
# -----------------------------------------------------------------------
#
# 1. Makes all filenames lowercase.
# 2. Changes the _ in the D70s-filenames to a chosen number between 0 and 9
# 3. Runs dcraw in cheapest mode for preview-jpg-pictures
# 4. Extracts exif-tags from nef-files and write them to preview-jpg-pictures.
# 5. Remove Orientation-exif-tag as dcraw has already rotated the picture.
#
# This script performs its operations on all nef-files present
# in current directory.
#
#############################################
# User servicable parts:
digit5=0 # The fifth digit in filenames.
##############################################
# First step in NEF-workflow.
# 1: Make all filenames lowercase
# 2: Add a fifth significant digit to filenames
for file in `ls *.NEF`
do
newname=`echo $file | tr [A-Z] [a-z] | tr [_] [${digit5}]`
mv $file $newname
done
# Second step in NEF-workflow.
# 3: Dcraw in fastest mode
# 4: Exif tags
# 5: Clear exif rotation-tag.
for neffile in `ls *.nef`
do
echo "Processing $neffile"
prejpgfile=${neffile%.nef}pre.jpg
jpgfile=${neffile%.nef}.jpg
if [ ! -f "$jpgfile" ] ; then
dcraw -h -q 0 -w -c $neffile | convert - $prejpgfile && \
cpexif $neffile $prejpgfile && \
jhead -norot $prejpgfile
else
echo "Skipped, $jpgfile exists"
fi
done
# Third step in NEF-workflow.
#
# Details of this script:
#
# 1. Runs dcraw in chosen default mode for finished jpg-pictures.
# 2. Extracts exif-tags from nef-files and write them to preview-jpg-pictures.
# 3. Deletes *pre.jpg files from step 1 of workflow.
# 4. Remove Orientation-exif-tag as dcraw has already rotated the picture.
###############################################
# User servicable parts:
#dcrawoptions="-h -q 3 -w -B 2 4"
dcrawoptions="-h -q 3 -w"
convertoptions="-quality 95 -sharpen 5"
################################################
# Function used in this script, takes one
# nef-file as the argument.
runneffile () {
neffile=$1
echo -n "Processing $neffile... "
prejpgfile=${neffile%.nef}pre.jpg
jpgfile=${neffile%.nef}.jpg
rm -f $prejpgfile # This file should go away now.
if [ ! -f "$jpgfile" ] ; then
dcraw $dcrawoptions -c $neffile \
| convert $convertoptions - $jpgfile && \
cpexif $neffile $jpgfile && \
jhead -norot $jpgfile && \
echo "done"
else
echo "SKIPPED, $jpgfile exists."
fi
}
###################################################
# Entry point of this script.
for neffile in `ls *.nef`
do
runneffile $neffile
done
Jeg har NIkon D50 så det burde funke. Hvordan skal jeg gå frem for å få dette scriptet til å fungere?
Sist endret av Blomsen Jr.; 30. juni 2007 kl. 16:06.