Created
May 15, 2019 16:11
-
-
Save erjiang/217943ae7b3f30b1b8e5f3ea252c1d38 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Given image files, check the file to see if it has an embedded rating. If it | |
# does, write it to a RawTherapee sidecar file (.pp3), unless there already is | |
# a sidecar file. | |
for FILE in $* | |
do | |
RATING=`exiftool -p '$Rating' $FILE` | |
if [ "$RATING" -ne "0" -a ! -z "$RATING" ] | |
then | |
if [ ! -f "$FILE.pp3" ] | |
then | |
echo Writing $RATING to $FILE.pp3 | |
printf "[General]\nRank=$RATING\n" > "$FILE.pp3" | |
else | |
echo Skipping: $FILE.pp3 already exists | |
fi | |
fi | |
done | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment