Batch switching "Title" and "Subject"

Started by evosheas, July 21, 2015, 08:50:42 AM

Previous topic - Next topic

evosheas

Ok so i am a super noob here, but have joined this forum in an attempt to solve an issue which nowhere else seems to even come close to solving.
Basically i have several thousand photographs where someone has assigned various different "Titles" to and also various different "Subject" information and i simply want to switch the information between the two fields (or attributes). Apologies for noob nomenclature or lack of details. If anyone needs any clarification, please just ask. I haven't even fired Exiftool up yet but if what i want to do is possible then i will be happy to step onto the learning curve.
Your assistance or advice is much appreciated.
Yours Sincerely in advance.

Phil Harvey

The basic command would look like this:

exiftool "-subject<title" "-title<subject" DIR

If you have problems, read FAQ 2 and 3.

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

evosheas

Thanks Phil, i will have a go and report back on the outcome.

evosheas

OK so i ended up setting up with the ExifGUI so i am not sure if i should start posting over there? However even in the GUI i still was using the Exiftool Direct button to input my commands and trying this
EXIF:"-description<title" "-title<description"
seems to push the description to the title but the second part of the command seems to fail, in other words the original title does not become the new description. It seems like one the first part happens, there is no trace of the original title (as it has now been replaced by the original description) and so it cannot copy the original title back to become the new description. Any suggestions? Sorry if the above description is unclear.
Cheers.

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

evosheas

Thanks Phil,
i thought i had to include the "EXIF:" prefix when working in the "Exiftool direct button" when using the GUI, as per some samples shown here
https://exiftool.org/gui/#p_etdirect
But i see now that not all examples begin with that prefix, for example i see one prefix is "-Xmp-aux:".
Not sure of the role of the prefixes at the moment.
Chhers.

Phil Harvey

In your case, if you use prefixes it would look like this:

"-xmp:description<xmp:title" "-xmp:title<xmp:description"

Because you are copying XMP metadata.

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

evosheas

Thanks again Phil.
I think i am beginning to understand a bit better now.
I think i have been able to achieve my goal using your suggested
"-xmp:description<xmp:title" "-xmp:title<xmp:description"
I say "i think" because when i check the files in windows explorer, whilst the "title" has changed to be populated with the original "subject" text, the "subject" remains unchanged and has not been populated with the original "title" text. So in fact the "title" and "subject" in windows explorer now show the same text. Even though in the Exiftool GUI window the intended does appear to have happened.
Also i get the following minor error too,
Warning: [minor] Unrecognized MakerNotes - ./2009.08.01 (13).JPG
Thinking that i might be beginning to comprehend the situation i tried the following,
"-xmp:description<iptc:objectname"
yet still in Windows Explorer the "Subject" and "Title" remain the same.
Again apologies if my explanation is hard to follow.
Cheers.

StarGeek

#8
The names used under Windows properties do not correlate directly to the actual metadata tags.  For example, Title under Windows will be populated by the following tags, in order of priority
1. EXIF:ImageDescription
2. EXIF:XPTitle
3. IPTC:Caption-Abstract
4. XMP:Description
5. XMP:Title

Subject is taken from, in order
1. EXIF:XPSubject
2. EXIF:ImageDescription
That's what a quick test revealed, still more testing to follow.

edit: Silly me, that info was already discovered in the Windows metadata thread.

Phil created the Windows metadata sticky thread to help collect this info.  I plan on working on this as I find time or as questions like this pop up.
* 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).

evosheas

Thanks for that Stargeek,
Your post allowed me to try a few different things and also steered me in the direction of what to look out for.
Part of my problem seems to have been that some of my files had an "xpsubject" field and some didn't.
It looks like i have mostly solved it with the following
"-exif:xpsubject<xmp:title" "-exif:imagedescription<xmp:title" "-xmp:title<exif:imagedescription"
I say mostly because the only problem i have with the above is that where there is no entry in the "xmp:Title" the switch doesn't happen.
Is there something i can add to the statement to say "switch even when blank" or similar?
Cheers.

Phil Harvey

If you want EXIF:XPSubject and EXIF:ImageDescription to be deleted if there is no XMP:Title, do this:

-exif:xpsubject= -exif:imagedescription= "-exif:xpsubject<xmp:title" "-exif:imagedescription<xmp:title" "-xmp:title<exif:imagedescription"

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

evosheas

Hi again,
I dropped off the radar for a couple of days.
I may not have explained myself correctly.
I don't want anything to be deleted.
As i mentioned below, where "xmp:Title" is blank, the following doesn't work.
"-exif:xpsubject<xmp:title" "-exif:imagedescription<xmp:title" "-xmp:title<exif:imagedescription"
I was hoping to add something to the statement that says in effect "even if there is no data in "xmp:Title" then still populate "xmp:Title" with the contents of "exif:xpsubject".
Again, i hope i am making sense.

Phil Harvey

Quote from: evosheas on July 30, 2015, 03:12:04 AM
"even if there is no data in "xmp:Title" then still populate "xmp:Title" with the contents of "exif:xpsubject".

In this case, you need to add "-xmp:title<exif:xpsubject" to the command.

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

evosheas

Thanks Phil, yeah that's basically it.
This is going to save me countless hours.
Your assistance was greatly appreciated.
Many thanks again.