Order of the keywords

Started by aniecki, October 27, 2020, 05:13:25 PM

Previous topic - Next topic

aniecki

I want to put some data into the keywords meta, the call
exiftool -addTagsFromFile @ -subject="machine" -subject="learning" '-subject<LightValue' IMG_0609.JPG

will do the job, yet the light value LV is at the beginning , but I want it to be applied at the end of the string
Is there a way to do this?

Thanks!
ps. Attachment supplied - with the LV at the beginning.

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

aniecki

I wish it does!
It does not say how to make a specific order in the keywords tag.

This is a list-type tag with writing and copying values, yet copying takes precedence. Is there a way to change that order so, it is if only writing the keywords list-type are applied.  Hope that can be achieved, but perhaps there is no control on the order of the words in keywords tag?

exiftool -addTagsFromFile @ -subject="machine" -subject="learning" '-subject<LightValue' IMG_0609.JPG

LV should be the 3rd value in the list, not the 1st.

Thanks.

Phil Harvey

3. Tags copied with the -tagsFromFile option are assigned in order, and all together at the point in the command line where the -tagsFromFile option is located, regardless of whether these tags are specified immediately after the -tagsFromFile option or later on the command line.

So you need to do this:

exiftool -subject="machine" -subject="learning" -addTagsFromFile @ '-subject<LightValue' IMG_0609.JPG
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

aniecki

Thanks Phil. Indeed so! Indeed so.

aniecki

Phil still to clarify it, as I now report on  the case.
You mentioned -tagsFromFile option, yet use -addTagsFromFile option in the call.
So perhaps you should update the FAQ 22 to mention such behaviour on -addTagsFromFile (as oposed to -tagsFromFile).



Phil Harvey

The FAQ is still valid, and -tagsFromFile should be used in most cases.  (ie. non list-type tags, or lists where the previous new values should be ignored).  And point 2 in the FAQ already describes the only case when -addTagsFromFile is required.

But to further confuse the situation for you...  Consider this case:

exiftool -subject=a -subject=b -addTagsFromFile @ '-subject<filename' -subject=c test.jpg

One might expect a resulting Subject of "a, b, test.jpg, c", but instead you will get "a.jpg, a, b, c", but adding -subject=c after the -addTagsFromFile changes the order of all the assignments to afterwards.  This is not documented because it would add more confusion to the already confusing documentation, and running into this situation would be exceedingly rare (but you have come very close with what you are doing!).  The reason is due to the underlying way that ExifTool queues the new values, and pushes and pops them from a stack each time a new input -tagsFromFile file is processed.  Also, I don't want to document this because I may eventually change the way the queue operates to make this work the way one would expect.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).