Choice to display Insta AND/OR Flickr

This commit is contained in:
2022-08-27 10:20:59 +02:00
parent 810401d4d6
commit fb24c60c1e

View File

@@ -19,7 +19,9 @@ reg=("Bourgogne" "Burgundy" "Bourgogne Franche-Comté" "Côte d'or")
#others=("lanscape" "animal")
others=()
# tags -t mammifere foret animal
# Display Instagram AND/OR Flickr tags
insta=true
flickr=true
opt_others=false
opt_lens=false
@@ -30,7 +32,7 @@ opt_wildlife=false
opt_all=true
showHelp() {
echo -e "${greenbold}keywords2insta${reset} v1.0"
echo -e "${greenbold}keywords2insta${reset} v1.1"
echo -e "Bruno <bruno<clicclac.info>"
echo -e "Read exif and keywords from an image file, and copy them to the clipboard, "
echo -e " ready for Instagram and Flickr."
@@ -89,7 +91,7 @@ do
nature) opt_nature=true;;
region) opt_region=true;;
file)
file="${!OPTIND}"; OPTIND=$(( $OPTIND + 1 ))
file="${!OPTIND}"; OPTIND=$(( OPTIND + 1 ))
;;
file=*)
file=${OPTARG#*=}
@@ -177,6 +179,8 @@ if [ -f ./keywords.csv ]; then
fi
echo -e "\n${greenbold}keywords2insta${reset} v1.1"
echo -e "\n${bold}Reading $file exif...${reset}"
exif=$(exiftool -Canon -s -Keywords "$file")
# The exiftool application exits with a status of 0 on success, or 1 if an
@@ -403,6 +407,7 @@ else
fi
if [ "$insta" = true ]; then
if [[ "$OSTYPE" == "linux-gnu" ]] && [ -x "$(command -v xsel)" ]; then
xsel -b <<< "$keywords_insta"
@@ -416,11 +421,15 @@ echo "$keywords_insta"
echo -e "\nPress <Enter> to get the Flickr' tags..."
read -p ""
fi
if [ "$flickr" = true ]; then
if [[ "$OSTYPE" == "linux-gnu" ]] && [ -x "$(command -v xsel)" ]; then
xsel -b <<< "$keywords_flickr"
elif [[ "$OSTYPE" == "darwin"* ]] && [ -x "$(command -v pbcopy)" ]; then
pbcopy <<< "$keywords_flickr"
fi
echo -e "\n${bold}Here the Flickr's tags too !${reset}"
[ "$insta" = true ] && echo -e "\n${bold}Here the Flickr's tags too !${reset}" || echo -e "\n${bold}The Flickr's tags are available in your clipboard !${reset}"
echo "$keywords_flickr"
fi