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,14 +32,14 @@ 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."
echo
echo -e "${yellow}USAGE:${reset}"
echo -e "${green}keyword2insta [-Options...] -f <file>${reset}"
echo -e "If no option is chosen, all tags are added (default). "
echo -e "If no option is chosen, all tags are added (default)."
echo -e "Keywords taken from exifs are automatically added."
echo -e "You can add keywords permanently by adding them to the ${underline}others array${reset} at the start of the script. (See others=())"
echo -e "The images files are not modified."
@@ -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,24 +407,29 @@ else
fi
if [[ "$OSTYPE" == "linux-gnu" ]] && [ -x "$(command -v xsel)" ]; then
xsel -b <<< "$keywords_insta"
elif [[ "$OSTYPE" == "darwin"* ]] && [ -x "$(command -v pbcopy)" ]; then
pbcopy <<< "$keywords_insta"
if [ "$insta" = true ]; then
if [[ "$OSTYPE" == "linux-gnu" ]] && [ -x "$(command -v xsel)" ]; then
xsel -b <<< "$keywords_insta"
elif [[ "$OSTYPE" == "darwin"* ]] && [ -x "$(command -v pbcopy)" ]; then
pbcopy <<< "$keywords_insta"
fi
echo -e "\n${bold}The Instagram's tags are available in your clipboard !${reset}"
echo "$keywords_insta"
echo -e "\nPress <Enter> to get the Flickr' tags..."
read -p ""
fi
echo -e "\n${bold}The Instagram's tags are available in your clipboard !${reset}"
echo "$keywords_insta"
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 "\nPress <Enter> to get the Flickr' tags..."
read -p ""
if [[ "$OSTYPE" == "linux-gnu" ]] && [ -x "$(command -v xsel)" ]; then
xsel -b <<< "$keywords_flickr"
elif [[ "$OSTYPE" == "darwin"* ]] && [ -x "$(command -v pbcopy)" ]; then
pbcopy <<< "$keywords_flickr"
[ "$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
echo -e "\n${bold}Here the Flickr's tags too !${reset}"
echo "$keywords_flickr"