Hi,
I have a YAD (Yet Another Dialog) bash script that I use with Thunar Custom Actions in Linux Mint to write information to images with Exiftool. This is the form box:
(http://i.imgur.com/XGXlco6.png)
This is the code:
#!/bin/bash
exiftoolform=$(yad --title "ExifTool" --form --field="Artist:" --field="Copyright:" --field="Headline:" --field="Description:" --field="Keywords:")
OldIFS="$IFS"; IFS='|' # Save the old IFS value to OldIFS and give the new value to IFS.
read ARTIST COPYRIGHT HEADLINE DESCRIPTION KEYWORDS <<< "$exiftoolform"
IFS="$OldIFS" # Give IFS back its original value.
exiftool -artist="$ARTIST" -copyright="$COPYRIGHT" -headline="$HEADLINE" -description="$DESCRIPTION" -keywords="$KEYWORDS" *.jpg
My problem is that when I add multiple keywords to the keywords box all the words are tied together as one keyword. I've tried separating the words in the following ways and nothing works:
+potato+latke+food+vendor
potato,latke,food,vendor
potato, latke, food, vendor
"potato,latke,food,vendor"
"potato, latke, food, vendor"
potato-latke-food-vendor
"potato""latke""food""vendor"
Any help would be appreciated.
I think that reading FAQ 17 (https://exiftool.org/faq.html#Q17) will help here.
- Phil
Hi, I read that FAQ yesterday and tried using the "-IPTC:Keywords=" tag instead of the "-keywords=" tag. I also tried the -sep option to split values of list-type tags into separate items when writing. The keywords would still get clumped together as one.
Quote from: rodertroy on July 31, 2015, 09:12:32 AM
Hi, I read that FAQ yesterday and tried using the "-IPTC:Keywords=" tag instead of the "-keywords=" tag.
Either will have the same effect.
QuoteI also tried the -sep option to split values of list-type tags into separate items when writing. The keywords would still get clumped together as one.
If the separator used is the same as the one specified by the
-sep option, then they will get split properly. I can't explain why you say this doesn't work.
- Phil
This is the modified bash script:
#!/bin/bash
exiftoolform=$(yad --title "ExifTool" --form --field="Artist:" --field="Copyright:" --field="Headline:" --field="Description:" --field="Keywords:")
OldIFS="$IFS"; IFS='|' # Save the old IFS value to OldIFS and give the new value to IFS.
read ARTIST COPYRIGHT HEADLINE DESCRIPTION KEYWORDS <<< "$exiftoolform"
IFS="$OldIFS" # Give IFS back its original value.
exiftool -sep ", " -artist="$ARTIST" -copyright="$COPYRIGHT" -headline="$HEADLINE" -description="$DESCRIPTION" -keywords="$KEYWORDS" *.jpg
And in the keywords form box I type:
"potato, latke, food, vendor"
When I upload the image to Flickr it lists all four keywords as one keyword. It's probably an issue with YAD.
What is the output of this command on the image you uploaded?
exiftool -keywords -sep x FILE
- Phil
exiftool -keywords -sep x 20150706_042354.jpg
Keywords : "sausagexmcdonaldxegg"
So they are stored correctly as separate keywords. The problem is elsewhere (Flickr?).
- Phil
Yes, it appears to be a problem with Flickr after all: https://www.flickr.com/help/forum/30000/?search=iptc
So it looks like I'll just have to create separate keyword fields in the form for multiple keywords instead of typing them all into the same field.
Thanks for your help!
I think you're confused. They are already stored separately as I said.
Yes, but according to the thread I linked to Fllckr handles separators between keywords (like commas) by jumbling them all together as one keyword.
I modified the script to two keyword fields and uploaded the image to Flickr. It now works. Flickr shows two keywords and doesn't jumble them together. It's just a shame I can't get it to work using one field for multiple keywords.
#!/bin/bash
exiftoolform=$(yad --title "ExifTool" --form --field="Artist:" --field="Copyright:" --field="Headline:" --field="Description:" --field="Keywords One:" --field="Keywords Two:")
OldIFS="$IFS"; IFS='|' # Save the old IFS value to OldIFS and give the new value to IFS.
read ARTIST COPYRIGHT HEADLINE DESCRIPTION KEYWORDSONE KEYWORDSTWO <<< "$exiftoolform"
IFS="$OldIFS" # Give IFS back its original value.
exiftool -sep ", " -artist="$ARTIST" -copyright="$COPYRIGHT" -headline="$HEADLINE" -description="$DESCRIPTION" -keywords="$KEYWORDSONE" -keywords="$KEYWORDSTWO" *.jpg
(http://i.imgur.com/sqArP95.png)
I was just looking at my Flickr page for the image I uploaded and in the exif data only one keyword is listed, though both keywords are listed as tags at the very bottom of the page, below the exif data. I then checked the uploaded image with the command you gave me:
exiftool -keywords -sep x 20150706_042354.jpg
I pressed enter and there's no output. It just created another command prompt. So that's kind of strange. And so I opened up the uploaded image in XNViewMP to look at the metadata and the keywords aren't listed, yet one of them is listed in the exif data on the Flickr page. So somehow I can't see the keywords in the metadata but Flickr sees one of them, and sees both of them to the extent that both appear as Flickr tags.
Quote from: rodertroy on July 31, 2015, 11:38:17 AM
Yes, but according to the thread I linked to Fllckr handles separators between keywords (like commas) by jumbling them all together as one keyword.
You misunderstand. In your image, there were no separators. The keywords were stored separately. No commas, no nothing. Effectively stored as separate tags.
Quote from: rodertroy on July 31, 2015, 12:08:53 PM
exiftool -keywords -sep x 20150706_042354.jpg
I pressed enter and there's no output.
You need to get your facts straight. Check the XMP:Subject maybe.
My guess is that you are fooling yourself by looking at the wrong metadata.
- Phil
Quote from: Phil Harvey on July 31, 2015, 12:20:23 PM
Quote from: rodertroy on July 31, 2015, 12:08:53 PM
exiftool -keywords -sep x 20150706_042354.jpg
I pressed enter and there's no output.
You need to get your facts straight. Check the XMP:Subject maybe.
My guess is that you are fooling yourself by looking at the wrong metadata.
- Phil
Sorry, I used the wrong command.
I just used this command and now I see both keywords:
exiftool -All FILE
Quote from: Phil Harvey on July 31, 2015, 12:19:11 PM
Quote from: rodertroy on July 31, 2015, 11:38:17 AM
Yes, but according to the thread I linked to Fllckr handles separators between keywords (like commas) by jumbling them all together as one keyword.
You misunderstand. In your image, there were no separators. The keywords were stored separately. No commas, no nothing. Effectively stored as separate tags.
I don't know what the problem is then.