It is currently Mon, 18-12-17, 11:00 GMT

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Anyone an IPTC expert?
PostPosted: Wed, 06-12-17, 7:47 GMT 
Offline
User avatar

Joined: Fri, 03-04-09, 8:21 GMT
Posts: 217
Anyone know how to batch edit IPTC metadata replacing all occurrences of a substring in a particular metadata field with another substring?
I have a folder of images whose metadata I want to edit on a selective pattern-matching basis.

eg. I might want to search for every occurrence of the string "Fred" in the Caption field, replacing it with "Jane".

So images with the following captions would be transformed like so:
Image 1: "This is Fred's dog" -> "This is Jane's dog"
Image 2: "This is Fred's cat" -> "This is Jane's cat"
Image 3: "This is Mary's dog" -> "This is Mary's dog"
Image 4: "This is Fred" -> "This is Jane"

Irfanview allows bulk changes to IPTC info, but is limited to "replacing" the entire field content, rather than a sub-string:
Attachment:
IrfanviewThumbsIPTC.jpg
IrfanviewThumbsIPTC.jpg [ 84.33 KiB | Viewed 120 times ]


ie.
You can enter a new caption:
"This is Jane's dog",
but every selected image's caption would be overwritten with that string:
Image 1: "This is Fred's dog" -> "This is Jane's dog"
Image 2: "This is Fred's cat" -> "This is Jane's dog"
Image 3: "This is Mary's dog" -> "This is Jane's dog"
Image 4: "This is Fred" -> "This is Jane's dog"


Not exactly what I had in mind.

CC

_________________
CITIZENS OF CM - JOIN THE REVOLUTION
...black out your avatar
THE AVATARS ARE REVOLTING !!!


Last edited by chuft-captain on Wed, 06-12-17, 14:16 GMT, edited 1 time in total.

Top
 Profile  
 
PostPosted: Wed, 06-12-17, 9:42 GMT 
Offline
User avatar

Joined: Sun, 02-09-07, 23:16 GMT
Posts: 123
Location: Upstate NY, USA
I know that many different IPTC editors are available, but I have no experience with any of them. See https://en.wikipedia.org/wiki/Compariso ... ta_editors

ExifTool looks like it might do what you want. See http://owl.phy.queensu.ca/~phil/exiftool/
Although it's a command-line utility, several different GUIs are available for it.

_________________
Selden


Top
 Profile  
 
PostPosted: Wed, 06-12-17, 14:05 GMT 
Offline
User avatar

Joined: Fri, 03-04-09, 8:21 GMT
Posts: 217
Thanks Selden,

(I'm quite comfortable with command-line.)

I've heard of ExifTool, but never used it. I think it has the reputation of being the "Mother of all EXIF tools", so if it can't be done in ExifTool I'd be very surprised. As this is just a one-off task I was hoping that I wouldn't have to learn yet another tool's syntax and methodology just for this one job, but it looks like I might just have to bite-the-bullet.

Essentially, I've got a lot of celURL's stored in the metadata of associated images, but as you know, each time you capture a celURL, it stores certain attributes of the celURL such as render-flags and label-flags as whatever they are set to at the time of capture, so you end up with a load of celURL's with various different flag settings.

So the idea is to apply consistent &rf and &lf settings across all these celURL's, so that my render settings are not constantly changing every time I click on a different celURL.

If I could edit them in Notepad++, I'd just use a very simple bit of regex, something like:
Code:
replace: &rf=[0-9]+
with: &rf=54167

and it would be done, and likewise for labelflags.
As good as Notepad++ is, sadly it does not edit IPTC data in images. (AFAIK :mrgreen: )

So, I think my options are:
1. Use EXIFTools to export IPTC data to some NP+ editable format, make the changes in NP+, then import the changed data back into the images with EXIFTools.
or:
2. Do the regex substitutions directly using EXIFTools, which would negate the need for any fluffing around with exporting and importing.

I'm almost certain that EXIFTools will handle both approaches (option 2 being the preferred approach)... just a matter of getting my head around it's syntax and huge set of features.

Thanks for the recommendation...

CC

PS. A quick google for "ExifTool regex" is showing some promising leads.... :D

_________________
CITIZENS OF CM - JOIN THE REVOLUTION
...black out your avatar
THE AVATARS ARE REVOLTING !!!


Top
 Profile  
 
PostPosted: Sun, 10-12-17, 2:28 GMT 
Offline
User avatar

Joined: Fri, 03-04-09, 8:21 GMT
Posts: 217
Code:
exiftool.exe -P -overwrite_original -m -api "Filter=s/&rf=\d*/&rf=%num1%/;s/&lm=\d*/&lm=%num2%/" -tagsfromfile @ -iptc:SpecialInstructions %filespec%

_________________
CITIZENS OF CM - JOIN THE REVOLUTION
...black out your avatar
THE AVATARS ARE REVOLTING !!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group