Compare commits
2 Commits
a1698fb293
...
f97a7bd82c
Author | SHA1 | Date |
---|---|---|
colm | f97a7bd82c | 5 years ago |
colm | 7684ad5a0c | 5 years ago |
2 changed files with 41 additions and 1 deletions
@ -1,3 +1,10 @@ |
|||||
# EXIF-image-commenter |
# EXIF-image-commenter |
||||
|
|
||||
a shell script to aid the adding of EXIF comments in photographs or images of most types. |
a shell script to aid the adding of EXIF comments in photographs or images of most types. |
||||
|
|
||||
|
## Dependencies : |
||||
|
* exiftool |
||||
|
|
||||
|
## Authors : |
||||
|
* MB |
||||
|
* slowrussia |
||||
|
@ -0,0 +1,33 @@ |
|||||
|
#!/bin/bash |
||||
|
|
||||
|
for f in *; do |
||||
|
|
||||
|
# First display the image ... |
||||
|
|
||||
|
# Check if Chafa is installed, otherwise use feh |
||||
|
# To install feh: $sudo apt install feh |
||||
|
if ! [ -x "$(command -v chafa)" ]; then |
||||
|
feh $f |
||||
|
else |
||||
|
chafa $f |
||||
|
fi |
||||
|
|
||||
|
# Then read the current comment of this image ... |
||||
|
|
||||
|
CURRENT=$(exiftool -S -Comment $f | sed 's/[^ ]* //') |
||||
|
echo "Currently this image is described as: $CURRENT" |
||||
|
|
||||
|
# Ask if the comment should be changed ... |
||||
|
|
||||
|
read -p "Would you like to edit this comment? [y/n] " choice |
||||
|
|
||||
|
case "$choice" in |
||||
|
y|Y ) read -p "Please enter your new comment: " comment ;; |
||||
|
n|N ) echo "Oke" && comment=$CURRENT;; |
||||
|
* ) echo "Sorry that is invalid. Please choose y or n.";; |
||||
|
esac |
||||
|
|
||||
|
# Save the new comment into the exif data |
||||
|
|
||||
|
exiftool $f -overwrite_original -Comment="$comment" |
||||
|
done |
Loading…
Reference in new issue