X-Git-Url: http://git.scottworley.com/picsort/blobdiff_plain/7a7a7a750c91bd80e6c7ae0a564c8914bc48298c..88880347cfae4f78b639e5bc18fb4912de7fb36f:/pic-mv diff --git a/pic-mv b/pic-mv index 2774a69..92444da 100755 --- a/pic-mv +++ b/pic-mv @@ -24,18 +24,24 @@ else number=1 fi +out="$destdir/$name $number.jpeg" + if [[ "$file" == *.NEF ]];then base="${file%.NEF}" + NEFout="$destdir/$name $number.NEF" if [[ "$rotate" ]];then - echo "NEF rotation not yet implemented" >&2 - exit 1 + numeric_exposure=$(dc <<< "2k $exposure 4 / 3.5-p") + pics-run-ufraw "$numeric_exposure" "$file" "$out" "$rotate" else - mv -vi "$exposure/$base.jpeg" "$destdir/$name $number.jpeg" - mv -vi "$file" "$destdir/$name $number.NEF" + mv -vi "$exposure/$base.jpeg" "$out" fi + touch -r "$file" "$out" + mv -vi "$file" "$NEFout" + chmod 644 "$NEFout" else if [[ "$rotate" ]];then - sed -i "s/^# ROBOTS_INSERT_THINGS_HERE\$/&\n\"$name $number.jpeg\" => $rotate," "$destdir/rotations.php" + sed -i "s/^# ROBOTS_INSERT_THINGS_HERE\$/\"$name $number.jpeg\" => $rotate,\n&/" "$destdir/rotations.php" fi - mv -vi "$file" "$destdir/$name $number.jpeg" + mv -vi "$file" "$out" fi +chmod 644 "$out"