-tagsfromfile json and batch. (flickr..)

Started by ichigo, February 12, 2020, 03:42:46 PM

Previous topic - Next topic

ichigo

Hello!

I have been here for 3 hours, trying to figure out things.

I have found this commandline:

exiftool -tagsfromfile %d/photo_%-9.2f.json ... -ext jpg E:\Process\media

It works on some of the flickr:s own downloaded files (change 9 to 11 or whatever if needed)

BUT I prefer to use Flickr Downloadr, and the format there is being:

000001.jpg and 000001.jpg.json

I thought "simple enough" and put wildcard. But nope. ;)
Then I realized it is windows command scripting, which is new to me.
I tried, and tried, and tried. But no.

Can you please help me come of a commandline that will process files that is formatted like above? It is sequential.

What I wanted to do is to shove everything from json into the exif.

THANK YOU!

Oh, BONUS REQUEST:
Put the TITLE to the Filename. ;)  (formatted exactly like the title, with cases etc)

Phil Harvey

It sounds like you want this:

exiftool -tagsfromfile %d%f.%e.json -ext jpg DIR

then to rename the files, maybe something like this:

exiftool "-testname<%f %{title;}.%e" -ext jpg -ext json DIR

Change "testname" to "filename" to actually do the renaming if this looks good to you.

- 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 ($).

StarGeek

The first thing to check is to see if you actually need to actually need to change anything.  Flickr does not edit the metadata from when the file was uploaded.  So the only time you need to do anything like this is if you changed any data on the Flickr website.

As long as the json files are in the same directory as the jpgs, the core part of the command would be
exiftool -TagsFromFile %d%F.json -ext jpg "-TAG1<JSONTAG1" "-TAG2<JSONTAG2"  E:\Process\media

Since the json files have the same name as the jpgs with ".json" added to the end, you can use %d%F.json.  The %d stands for the directory, %F is the complete filename including the extension (%f, lowercase, is the filename without the extension).

TAG# would be replaced by the name of the tag in the jpg you want to copy to.  JSONTAG# would be the name of the tag in the json file you want to copy from.  In order to find out the names of the tags in the json file, you would run
exiftool -s File.json
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

ichigo

Quote from: Phil Harvey on February 12, 2020, 04:11:34 PM
It sounds like you want this:

exiftool -tagsfromfile %d%f.%e.json -ext jpg DIR


This worked but only for the Title.
The description and the tags did not go over at all.

I guess tags would need to be stored in the Keywords area?

The json content looks like this:
{"Tags":"doll lavender blythe velvetminuet sbl lavenderfields pchips funnybunny solidbackground fbfashion","Description":"With new gown. Custom made sparkly P-chips eyechips showing here. Aswell as my modifications of whitened eyeballs and boggled eyes. I love how white eyeballs make a big change on early superiors.","Title":"Lavender Fields"}

(sorry for not have done "anonymizing" the content above, haha)

So the Title is what went over successfully, but not Description nor Tags.
(by using the command in the quote by Phil above)

Now I need to go to bed, I will continue try to fight/figure out this tomorrow. But if you have suggestions meanwhile I would be happy to read.

Thanks again for replies!   :D

Btw, StarGeek, the information I wanted to have was what I have typed into Flickr, so sadly I needed to do that.

ichigo

#4
Continuing with  above;

Now trying with the keywords.

E:\Process\2007a>E:\process\exiftool -sep " " -tagsfromfile 000001.jpg.json -key
words 000001.jpg
Warning: No writable tags set from 000001.jpg.json
    0 image files updated
    1 image files unchanged


I got it so that the exiftool won't recognize the tags format in the json file? Right?  (see json format in previous post)

What can I do to get exiftool to recognize it? Or to change it into readable format?

StarGeek

As I said, you need to find out what the names used in the json file are.

Quote from: StarGeek on February 12, 2020, 04:16:31 PMIn order to find out the names of the tags in the json file, you would run
exiftool -s File.json

Once you do that, you need to decide where they go in the image file, probably Subject or KeywordsSubject is the newer XMP standard for keywords, Keywords is the older IPTC/IIM standard.

And you're probably correct about including the -Sep part.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

ichigo

I finally got it to work. I thought I had to actually write "json" in the tag field. :P (such as keywords<jsontags :P