Author Topic: Please restore copy XMP to IPTC function  (Read 23930 times)

doug kerr

  • Jr. Member
  • **
  • Posts: 13
Please restore copy XMP to IPTC function
« on: September 14, 2011, 12:13:01 PM »
Hi, Bogdan,

I would like to see the ExifToolGUI function IPTC: copy data to from XMP restored.

I typically will work up my IPTC metadata in the IPTC XMP  ("XMP") context. But then I like to copy the metadata to the IPTC IIM ("IPTC") form, as many recipients may have readers that only display the IIM form, not the XMP form.

Thanks.

Best regards,

Doug

BogdanH

  • Moderator
  • ExifTool Freak
  • *****
  • Posts: 757
  • ExifToolGUI Author
Re: Please restore copy XMP to IPTC function
« Reply #1 on: September 14, 2011, 02:45:40 PM »
Hi Doug,

I don't wish to encourage the usage of "old, abandoned, not maintained anymore" Iptc standard -and that's the only reason why this option (copy from Xmp to Iptc) is not included in GUI v4 -don't stop reading now!  :)

I have (much) better idea:
1. Go to ExifTool main page and download "Download Version n.nn" (right now, n.nn=8.64) -which is full ExifTool with source. Unpack the content and open main "Image-ExifTool-n.nn" folder. Now look after file "xmp2iptc.args" (there's also i.e "iptc2xmp.args" file) and copy that file into Windows directory.
2. Open ExifToolGUI and select files on which you wish to copy Xmp data to Iptc.
3. Click on button ExifTool direct and write the following command there:
-@ xmp2iptc.args
-and press Enter. You can see, that all "compatible" data was copied from Xmp to Iptc. Great, huh?  :)

If you wish to "remember" that command, then:
4. Click on Edit predefined button and write the name you like (for that command) into Command name field, i.e.: Copy from Xmp to Iptc -and click on ^Add new button.
That's it -next time, you can simply select that command from drop down list.

I hope, this was of some help for you.

Bogdan
PS: Phil, thank you for these args files -maybe you should include them into Windows executable..?

doug kerr

  • Jr. Member
  • **
  • Posts: 13
Re: Please restore copy XMP to IPTC function
« Reply #2 on: September 14, 2011, 05:16:48 PM »
Hi, Bogdan,

I don't wish to encourage the usage of "old, abandoned, not maintained anymore" Iptc standard -and that's the only reason why this option (copy from Xmp to Iptc) is not included in GUI v4 -don't stop reading now!
I understand. That of course is my own preference. But . . .

Quote
I have (much) better idea:
1. Go to ExifTool main page and download "Download Version n.nn" (right now, n.nn=8.64) -which is full ExifTool with source. Unpack the content and open main "Image-ExifTool-n.nn" folder. Now look after file "xmp2iptc.args" (there's also i.e "iptc2xmp.args" file) and copy that file into Windows directory.
2. Open ExifToolGUI and select files on which you wish to copy Xmp data to Iptc.
3. Click on button ExifTool direct and write the following command there:
-@ xmp2iptc.args
-and press Enter. You can see, that all "compatible" data was copied from Xmp to Iptc. Great, huh?
Fabulous!

Quote
If you wish to "remember" that command, then:
4. Click on Edit predefined button and write the name you like (for that command) into Command name field, i.e.: Copy from Xmp to Iptc -and click on ^Add new button.
That's it -next time, you can simply select that command from drop down list.
Way cool! I'll try that.

Thanks.

Best regards,

Doug

doug kerr

  • Jr. Member
  • **
  • Posts: 13
Re: Please restore copy XMP to IPTC function
« Reply #3 on: September 14, 2011, 05:46:05 PM »
Hi, Bogdan,

Way cool. Worked fine with two glitches:

• I got an invalid time format in IPTC(!) warning. Curious. I'll have to poke around a little.

• When I click on the ExifTool direct button, the app window doesn't expand vertically enough to accommodate the panel with the other buttons  - I just see the very tops of the buttons. (I have the app not-maximized, so it isn't a problem of them being blocked by the task bar.) I have a screen shot, but I have to mount it on my host so I can embed it in a post here (I guess) so maybe later.

But otherwise, it worked fine. Thanks.

Best regards,

Doug

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18370
    • ExifTool Home Page
Re: Please restore copy XMP to IPTC function
« Reply #4 on: September 14, 2011, 06:35:50 PM »
PS: Phil, thank you for these args files -maybe you should include them into Windows executable..?

A good idea, but I don't know how this could be done.  I don't want to just add them to the .zip file because this would complicate things for the users, and I don't know of a way to add them to the .exe package.

• I got an invalid time format in IPTC(!) warning. Curious. I'll have to poke around a little.

I can help if you post the original XMP that caused this problem: exiftool -xmp -b a.jpg > out.xmp

Edit: Belay that request.  I figured out the likely problem:  XMP allows incomplete date/time values.  If the XMP date/time value does not contain a time (ie. only a year or date) then you will get this message when you try to copy it to an IPTC time tag.  Let me know if this isn't the problem.

Quote
I have to mount it on my host so I can embed it in a post here (I guess) so maybe later.

You should be able to add it as an attachment to a post here.  Attachments are downloadable by members only, and not viewed as inline images.

- Phil
« Last Edit: September 14, 2011, 06:45:45 PM by Phil Harvey »
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

doug kerr

  • Jr. Member
  • **
  • Posts: 13
Re: Please restore copy XMP to IPTC function
« Reply #5 on: September 14, 2011, 08:17:45 PM »
Hi, Phil,


• I got an invalid time format in IPTC(!) warning. Curious. I'll have to poke around a little.

I can help if you post the original XMP that caused this problem: exiftool -xmp -b a.jpg > out.xmp

Edit: Belay that request.  I figured out the likely problem:  XMP allows incomplete date/time values.  If the XMP date/time value does not contain a time (ie. only a year or date) then you will get this message when you try to copy it to an IPTC time tag.  Let me know if this isn't the problem.

Almost certainly! The date in the XMP was date only, not date-time.

Does this mean that we try to make an invalid IPTC date? (Older versions of ExifToolGUI did this with no complaint, but maybe made something invalid in the IPTC.)

I'll do a little reverse engineering here.

The error message is a bit misleading!

Quote
Quote
I have to mount it on my host so I can embed it in a post here (I guess) so maybe later.

You should be able to add it as an attachment to a post here.  Attachments are downloadable by members only, and not viewed as inline images.

Good. Of course, inline would have been easier, and I regularly do that elsewhere (mount it on my server so it can be an inline image), but I was just too lazy today!

Thanks.

Best regards,

Doug

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18370
    • ExifTool Home Page
Re: Please restore copy XMP to IPTC function
« Reply #6 on: September 15, 2011, 07:30:16 AM »
Hi Doug,

Does this mean that we try to make an invalid IPTC date? (Older versions of ExifToolGUI did this with no complaint, but maybe made something invalid in the IPTC.)

I'll do a little reverse engineering here.

The error message is a bit misleading!

They shouldn't write an invalid date.  I'm not sure why older versions didn't give a message.  What version of exiftool are we talking about and I can check this?

I agree the error is a bit misleading, but it is hard to be more specific because the conversion routine accepts just about anything and tries to pull a valid time out of it.  If it can't pull out a time, then it gives this message.  Here, it is trying to pull a time out of an XMP date/time value, but the IPTC time conversion routine of course doesn't know this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

doug kerr

  • Jr. Member
  • **
  • Posts: 13
Re: Please restore copy XMP to IPTC function
« Reply #7 on: September 15, 2011, 10:49:30 AM »
Hi, Phil,

Does this mean that we try to make an invalid IPTC date? (Older versions of ExifToolGUI did this with no complaint, but maybe made something invalid in the IPTC.)

I'll do a little reverse engineering here.

The error message is a bit misleading!

They shouldn't write an invalid date.  I'm not sure why older versions didn't give a message.  What version of exiftool are we talking about and I can check this?

Perhaps my comment wasn't explicit enough. I had not tried the ExifTool direct approach before. What I used to do was invoke the ExifToolGUI function IPTC: copy from XMP. That seemed to work fine, and no error message came to me in the process. ExifTool may well have issued one "to GUI".

I any case, I have created thousands of images in which the IPTC (that is, IPTC IIM) has a created date with no time component (which I guess is, strictly speaking, illegal).

In many cases, depending on the work flow, I have no idea what the created time is (for example, the Exif metadata may have already been lost or deleted). I just enter the date via ExifToolGUI and then blow all that over to the IPTC area when I am done.

Quote
I agree the error is a bit misleading, but it is hard to be more specific because the conversion routine accepts just about anything and tries to pull a valid time out of it.  If it can't pull out a time, then it gives this message.  Here, it is trying to pull a time out of an XMP date/time value, but the IPTC time conversion routine of course doesn't know this.

I understand - "Check engine soon".

Thanks.

Best regards,

Doug

doug kerr

  • Jr. Member
  • **
  • Posts: 13
Re: Please restore copy XMP to IPTC function
« Reply #8 on: September 15, 2011, 11:04:14 AM »
Hi, Phil,

I note with interest that in the latest version I have of the IPTC-NAA IIM spec (Version 4, July 1999), Date Created and Time Created are two separate data sets ("fields"), both optional (per section 1.4).

Date Created is data set 2:55 (8 octets, ASCII numeric characters) and Time Created is data set 2:56  (11 octets, ASCII graphic characters), both in Application Record no. 2.

Thus it does not seem right to declare an error simply because there is no source data for one of them.

And my thousands of files are legitimate (at least in that regard)!

Best regards,

Doug

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18370
    • ExifTool Home Page
Re: Please restore copy XMP to IPTC function
« Reply #9 on: September 15, 2011, 11:17:11 AM »
Hi Doug,

You are correct.  The date and time tags are separate in IPTC IIM, and one may exist happily without the other (ie. this is allowed by the spec).

Thus it does not seem right to declare an error simply because there is no source data for one of them.

Agreed, but the source is an XMP date/time tag, which may exist but without a time value.  Hence the warning when xmp2iptc.args tries to copy this to an IPTC time tag.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BogdanH

  • Moderator
  • ExifTool Freak
  • *****
  • Posts: 757
  • ExifToolGUI Author
Re: Please restore copy XMP to IPTC function
« Reply #10 on: September 15, 2011, 12:21:14 PM »
Hi,

Just came from work and after quick reading here, my add:
When copying "similar" tags from Xmp to Iptc in "old" GUI, only one date related command was used:
-iptc:DateCreated<xmp-photoshop:DateCreated
-that is, Iptc:TimeCreated was not populated.
At that time, my though was, that if user manually entersDateCreated, he won't bother with time (say, exact time isn't of that importance) -especially because Xmp allows date only.
For the same reason, in "new" GUI, for manually entering DateCreated, there's only space for date value. However, if option copy from Exif:CreateDate is checked, then complete DateTime value is copied into Xmp:DateCreated.

From what I can see, Xmp2Iptc.args "behaves" as expected, except warning message about "Invalid Time format" is misleading in case, Time part is just missing in Xmp:DateCreated.

Bogdan

doug kerr

  • Jr. Member
  • **
  • Posts: 13
Re: Please restore copy XMP to IPTC function
« Reply #11 on: September 15, 2011, 02:11:38 PM »
Hi, Bogdan,

Hi,

Just came from work and after quick reading here, my add:
When copying "similar" tags from Xmp to Iptc in "old" GUI, only one date related command was used:
-iptc:DateCreated<xmp-photoshop:DateCreated
-that is, Iptc:TimeCreated was not populated.
At that time, my though was, that if user manually entersDateCreated, he won't bother with time (say, exact time isn't of that importance) -especially because Xmp allows date only.
For the same reason, in "new" GUI, for manually entering DateCreated, there's only space for date value. However, if option copy from Exif:CreateDate is checked, then complete DateTime value is copied into Xmp:DateCreated.

From what I can see, Xmp2Iptc.args "behaves" as expected, except warning message about "Invalid Time format" is misleading in case, Time part is just missing in Xmp:DateCreated.
All makes perfect sense to me.

Thanks.

Best regards,

Doug

BogdanH

  • Moderator
  • ExifTool Freak
  • *****
  • Posts: 757
  • ExifToolGUI Author
Re: Please restore copy XMP to IPTC function
« Reply #12 on: September 15, 2011, 02:41:59 PM »
PS: Phil, thank you for these args files -maybe you should include them into Windows executable..?

A good idea, but I don't know how this could be done.  I don't want to just add them to the .zip file because this would complicate things for the users, and I don't know of a way to add them to the .exe package.

Yes, I know what you mean (just realized that). Anyway, I will mention usage of these args files in GUI manual as well.

Bogdan

doug kerr

  • Jr. Member
  • **
  • Posts: 13
Re: Please restore copy XMP to IPTC function
« Reply #13 on: September 22, 2011, 11:54:04 AM »
Hi, Phil,

Just to get closure on this matter:

Is it your position that to receive error messages from ExifTool when using the xmp2iptc.args file  to do XMP -> IPTC copy when there is no Created Time in the XMP source is appropriate, or impractical to avoid, or something?

Thanks.

Best regards,

Doug

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 18370
    • ExifTool Home Page
Re: Please restore copy XMP to IPTC function
« Reply #14 on: September 22, 2011, 12:20:47 PM »
Hi Doug,

I believe this message is appropriate and informative when using a command such as:

exiftool -IPTC:TimeCreated="anything that doesn't contain a valid time" ...

It is probably still appropriate, but less easy to see what is going wrong when you do this:

exiftool "-IPTC:TimeCreated<XMP-photoshop:DateCreated" ...

And I think still appropriate, but even further removed from the actual source of the problem with a command like this:

exiftool -@ xmp2iptc.args ...

(which just uses "-IPTC:TimeCreated<XMP-photoshop:DateCreated" in the argfile to copy this value).

So my position is that the message is appropriate and impractical to avoid, but not necessarily as informative as one might like in this situation.  However, I think it is also impractical to tune the warning message for a specific case like this.

- Phil
« Last Edit: September 22, 2011, 12:27:39 PM by Phil Harvey »
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).