ExifTool Forum

ExifTool => Newbies => Topic started by: evosheas on July 21, 2015, 08:50:42 AM

Title: Batch switching "Title" and "Subject"
Post by: evosheas on July 21, 2015, 08:50:42 AM
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.
Title: Re: Batch switching "Title" and "Subject"
Post by: Phil Harvey on July 21, 2015, 08:58:00 AM
The basic command would look like this:

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

If you have problems, read FAQ 2 and 3 (https://exiftool.org/faq.html).

- Phil
Title: Re: Batch switching "Title" and "Subject"
Post by: evosheas on July 21, 2015, 05:05:03 PM
Thanks Phil, i will have a go and report back on the outcome.
Title: Re: Batch switching "Title" and "Subject"
Post by: evosheas on July 22, 2015, 08:04:32 AM
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.
Title: Re: Batch switching "Title" and "Subject"
Post by: Phil Harvey on July 22, 2015, 08:53:15 AM
What is the "EXIF:" for?
Title: Re: Batch switching "Title" and "Subject"
Post by: evosheas on July 22, 2015, 09:44:50 PM
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.
Title: Re: Batch switching "Title" and "Subject"
Post by: Phil Harvey on July 23, 2015, 06:59:09 AM
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
Title: Re: Batch switching "Title" and "Subject"
Post by: evosheas on July 24, 2015, 10:06:37 PM
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.
Title: Re: Batch switching "Title" and "Subject"
Post by: StarGeek on July 25, 2015, 01:06:18 AM
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 (https://exiftool.org/forum/index.php/topic,6591.0.html) sticky thread to help collect this info.  I plan on working on this as I find time or as questions like this pop up.
Title: Re: Batch switching "Title" and "Subject"
Post by: evosheas on July 25, 2015, 06:00:48 PM
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.
Title: Re: Batch switching "Title" and "Subject"
Post by: Phil Harvey on July 25, 2015, 07:11:17 PM
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
Title: Re: Batch switching "Title" and "Subject"
Post by: evosheas on July 30, 2015, 03:12:04 AM
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.
Title: Re: Batch switching "Title" and "Subject"
Post by: Phil Harvey on July 30, 2015, 07:08:07 AM
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
Title: Re: Batch switching "Title" and "Subject"
Post by: evosheas on July 30, 2015, 07:25:46 PM
Thanks Phil, yeah that's basically it.
This is going to save me countless hours.
Your assistance was greatly appreciated.
Many thanks again.