Author Topic: Possible to merge NEF and JPG IPTC info?  (Read 6636 times)

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Possible to merge NEF and JPG IPTC info?
« on: November 05, 2007, 09:46:32 PM »
Before I converted to PM, I would place all my NEFs in a directory and all the jpgs in a subdirectory.  I would then edit the jpg IPTC info and upload the photos onto my web site.

With PM, I know how I can sync up the IPTC info between the jpg and NEF files, but is there a way that the jpg IPTC fields (caption & keywords) can be appended or merged into (and not replace) the NEF IPTC info?

Deven

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Possible to merge NEF and JPG IPTC info?
« Reply #1 on: November 06, 2007, 02:48:05 AM »
What do you mean by appending/merging the fields?  Do you mean that both the NEF and the JPG contain information in the fields and you want to have the result be both values added?  E.g. the caption in the JPG contains "JPG caption", the NEF contains "NEF caption", the result should then be "JPG CaptionNEF Caption" or something similar?

This is currently not possible (but read on for potential work-around) and also introduces lots of questions like: what field should go first, what separator should be used (space, newline, nothing?), etc.  This would be very complex, if not undoable...

However, you may try to see if the following would work:
1. Set up an IPTC template that copies fields that you want "merged/appended" to another field (e.g., caption to headline: Headline={caption}).  It is important that this field has not been used yet (in neither the JPGs, nor the NEFs!)
2. Apply this template to one set of files (e.g. the NEFs or the JPGs).
3. Synchronise the IPTC data.  The caption field would now contain the "original" caption, the headline field, the "other" caption.
4. Set up an IPTC template that concatenates the two fields to yet a third (previously unused) field. E.g., Contact Email(s)={caption} {headline}.

You may need to choose your fields carefully (some have size restrictions)...

Hope this helps.
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: Possible to merge NEF and JPG IPTC info?
« Reply #2 on: November 06, 2007, 07:08:17 AM »
What do you mean by appending/merging the fields?  Do you mean that both the NEF and the JPG contain information in the fields and you want to have the result be both values added?  E.g. the caption in the JPG contains "JPG caption", the NEF contains "NEF caption", the result should then be "JPG CaptionNEF Caption" or something similar?

Yes, I want to merge the caption and keyword fields.

Quote
This is currently not possible (but read on for potential work-around) and also introduces lots of questions like: what field should go first, what separator should be used (space, newline, nothing?), etc.  This would be very complex, if not undoable...

True, although keyword merging would be easier.

Quote
3. Synchronise the IPTC data.  The caption field would now contain the "original" caption, the headline field, the "other" caption.

Really?  I thought when you synchronized (using the  Update IPTC/XMP command) that the IPTC data of one would be copied exactly to the other, including blank fields in one erasing the contents of the other.  If not, could you explain how to do this?

Deven

Offline Hayo Baan

  • Uber Member
  • ******
  • Posts: 2552
  • Professional Photographer & Software Developer
    • View Profile
    • Hayo Baan - Photography
Re: Possible to merge NEF and JPG IPTC info?
« Reply #3 on: November 08, 2007, 01:55:48 AM »
Quote
3. Synchronise the IPTC data.  The caption field would now contain the "original" caption, the headline field, the "other" caption.

Really?  I thought when you synchronized (using the  Update IPTC/XMP command) that the IPTC data of one would be copied exactly to the other, including blank fields in one erasing the contents of the other.  If not, could you explain how to do this?
Deven, darn, you're right; it takes all the fields of the "source", overwriting the "destination" completely  :-[
Because of this my proposed work-around won't work at all, sorry :(

The only other option I see now is to make use of e.g., exiftools to extract the fields from one file and then add them to the other.  This is going to take you some programming though...
Hayo Baan - Photography
Web: www.hayobaan.nl

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: Possible to merge NEF and JPG IPTC info?
« Reply #4 on: July 06, 2008, 01:55:11 PM »
Finally found a solution to this problem: ExifTool.

ExifTool is an extremely powerful command line tool written in Perl.  You can google ExifTool and find out more about it.  Here is the command to do what I originally described:

exiftool -TagsFromFile j4bgs7_4917.jpg "-caption-abstract>headline" "-keywords+>keywords" j4bgs7_4917.nef

The command

1. copies the caption-abstract field from j4bgs7_4917.jpg to the headline field of j4bgs7_4917.nef

2. adds the keywords field from j4bgs7_4917.jpg to the keywords field of j4bgs7_4917.nef

Deven

Offline vAfotoriporter

  • Uber Member
  • ******
  • Posts: 1041
    • View Profile
    • Attila Volgyi photojournalist
Re: Possible to merge NEF and JPG IPTC info?
« Reply #5 on: July 06, 2008, 06:12:53 PM »
You may do a text export like
{fbas}.jpg{tab}{keywords}

Then set it as a code replacement file and adding /{fbas}.jpg/ to your keywords field should fill in your JPG keywords into the keyword fields of the NEF file.

Works similar than if you would synchronize just it is done through one or more code replacement files. If you use more than one of these files don't forget to find a system of individual strings so {fbas} can be used only with one field.
Working on Mac, OSX, iOS and with some Canons.
Allways shooting RAW.

http://www.volgyiattila.com

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: Possible to merge NEF and JPG IPTC info?
« Reply #6 on: July 06, 2008, 07:36:49 PM »
How do you do a text export?

Deven

Offline vAfotoriporter

  • Uber Member
  • ******
  • Posts: 1041
    • View Profile
    • Attila Volgyi photojournalist
Re: Possible to merge NEF and JPG IPTC info?
« Reply #7 on: July 06, 2008, 08:19:08 PM »
How do you do a text export?

Deven

Select your images, in the menu select File/Export. In the dialog box select the template Text Exporter which only has one large text box allowing you to enter the formula (with PM variables) in which you intend to export your image data to a text file.

It has two options to chose from: create one file and add each image info to the same file or to generate separate text files for all images individually. The earlier is better for creating a code replacement file.
Working on Mac, OSX, iOS and with some Canons.
Allways shooting RAW.

http://www.volgyiattila.com

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: Possible to merge NEF and JPG IPTC info?
« Reply #8 on: July 06, 2008, 10:19:32 PM »
Ahhh ....

I always thought the Exporter was just for creating HTML files.  I didn't realize there was a text exporter.  There is always something to learn about PM  :D

I can see how your method would work, but given that I am transferring two fields I think my approach may require less effort.

Thanks,

Deven

Offline vAfotoriporter

  • Uber Member
  • ******
  • Posts: 1041
    • View Profile
    • Attila Volgyi photojournalist
Re: Possible to merge NEF and JPG IPTC info?
« Reply #9 on: July 07, 2008, 08:37:55 AM »
Ahhh ....

I always thought the Exporter was just for creating HTML files.  I didn't realize there was a text exporter.  There is always something to learn about PM  :D

I can see how your method would work, but given that I am transferring two fields I think my approach may require less effort.

Thanks,

Deven

Your method may be easier (I wouldn't choose it for myself not knowing Exifer, and its use).
The text exporter way is almost the same for two or more fields since you can export them in one round.

You export like:
{fbas}1{tab}field1
{fbas}2{tab}field2
{fbas}3{tab}field3

Then you set this export file as code replacement file and apply an IPTC stationery for all files having /{fbas}1/ in one field you want to add that value than /{fbas}2/ for the other and /{fbas}3/ for the third one.

It can be used for any number of fields and can do both the export and the reapplying them in one turn regardless of fields involved.

I usually use this method to transfer data entered by someone on one site to another site over the Internet without having to transfer all the images every time. You only send few kb text files instead of gigs of images.
Working on Mac, OSX, iOS and with some Canons.
Allways shooting RAW.

http://www.volgyiattila.com

Offline devenh

  • Sr. Member
  • ****
  • Posts: 435
    • View Profile
Re: Possible to merge NEF and JPG IPTC info?
« Reply #10 on: July 07, 2008, 08:43:45 AM »
Yes, I figured this out and already ran a test this morning.  It certainly works  :D 

I have to process over 20,000 images so I'm going to do a bit more testing before I commit to either method.  It is nice to have a choice ...

Deven