News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Please restore copy XMP to IPTC function

Started by doug kerr, September 14, 2011, 12:13:01 PM

Previous topic - Next topic

BogdanH

Hi Phil,

I'll ask here, because it's related to discussion in this thread. Does something like this:
-iptc:TimeCreated<xmp:DateCreated -if Length(xmp:DateCreated)>10
...exist in Perl? You get the idea  :)

Bogdan

Phil Harvey

Hi Bogdan,

Yes, you can do this in Perl, but ExifTool doesn't have a feature to apply a condition when writing individual tags.

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

BogdanH

Thank you, Phil. I didn't thing about args rule.

Bogdan

BogdanH

In case Doug comes along...

I've digged a bit and here's my idea about error message appearing in case xmp:DateCreated doesn't contain Time part:

First, you need to modify xmp2iptc.args file, by commenting particular line there:
...
# magically extracts time from a date/time value
# -IPTC:TimeCreated < XMP-photoshop:DateCreated
...


In GUI, enter the following command into ExifTool direct field:
-if (length($xmp:DateCreated)>10) "-iptc:TimeCreated<xmp:DateCreated" -execute -@ xmp2iptc.args -common_args -overwrite_original

It seems to work properly here, but try on non-sensitive files first  :)

Bogdan

Phil Harvey

Quote from: BogdanH on September 24, 2011, 12:07:08 PM
In GUI, enter the following command into ExifTool direct field:
-if (length($xmp:DateCreated)>10) "-iptc:TimeCreated<xmp:DateCreated" -execute -@ xmp2iptc.args -common_args -overwrite_original


The -if is totally unnecessary because xmp2iptc.args accomplishes this anyway.  I think the only problem that Doug had was that xmp2iptc.args issues an "Invalid time format" warning, but it would with your command too (unless the GUI hides the warning).

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

BogdanH

No, above I said, he should "comment" (thus, disable) -Iptc:TimeCreated < xmp.... line in args file, so this command is never executed. However, if my if statement is true, then this command will be executed additionally.
This way, warning message doesn't appear. Instead of that, "regular" message x files failed condition might appear.
At the end, I'm not sure, if that makes any difference for user. Probably, I was just exercising Perl commands in Exiftool :)

Bogdan

Phil Harvey

Quote from: BogdanH on September 24, 2011, 03:38:06 PM
No, above I said, he should "comment" (thus, disable) -Iptc:TimeCreated < xmp.... line in args file

Sorry, I missed that.  I understand now.

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

dd-b

Yeah, this topic is nearly 10 years old.

But the progression of XMP replacing IPTC (or not doing so) is a significant part of the topic of this thread, and it's still an issue.

My latest personal example is that Piwigo, one of the major open-source photo gallery web site packages, doesn't handle XMP data. So when Darktable puts the names of the people I tagged as present into the xmp:dc-subject field (that's from memory; I think it's somewhat related to the right name :-) ), Piwigo doesn't see them. So I'm looking at using an extra step, using Exiftool to fix that. The published file of tags to copy will work fine for that (as well as is possible given the differences between IPTC and XMP). But the bigger story is still there.

Piwigo is written in PHP. Checking the Piwigo forums and PHP docs, I believe they're using the iptcparse feature in PHP. So far as I can tell there is no corresponding feature to handle XMP format metadata. So...what I'm saying here is that, across however long it's been going on (more than a decade), the attempt to chase people into XMP has not been entirely successful. And that supporting IPTC is really quite important still for people trying to make actual use of free software to deal with photos with metadata locally and on the web.

It's my observation that the Adobe tools, Bridge, and Lightroom and Photoshop, seem to manage to provide access to the new fields while keeping the old fields populated. And that commercial online galleries like Flickr do, too. This may be starting to be a dividing line, where the better, commercial, tools handle this and the cheaper, open source tools do not. Which is not good, certainly for those of us who prefer to use open source software where possible (I'm entirely stuck in the Adobe tool chain, though, for fine printing of photos, and also for video editing, sadly).

I don't really know what exiftool in particular should (or can) do to make this situation better rather than worse; but I want to put it out there that the problem is a real problem, and not one that the field has moved past.

Phil Harvey

Quote from: dd-b on October 19, 2020, 02:33:20 PM
I don't really know what exiftool in particular should (or can) do to make this situation better rather than worse; but I want to put it out there that the problem is a real problem, and not one that the field has moved past.

ExifTool makes this situation better by providing an open source tool to allow you to easily move metadata from one format to another.  But this isn't really a function of the GUI (the board you posted in), but the exiftool application and the Image::ExifTool Perl library.

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

StarGeek

It should be pointed out that, as per the sticky thread in this part of the forum, the exiftool gui has been unsupported for nearly 8 years.

I haven't tried it but you might take a look at the newer hvdwolf's jExifToolGUI.  They've been regular with updates.  I don't know if it can do this exact operation, but if not you could ask for such support in that thread.
* 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).

Phil Harvey

If you want this function in ExifToolGUI, couldn't you just use -@ xmp2iptc.args in the "exiftool direct" box?

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

StarGeek

If you don't already have the xmp2iptc.args file, you can get it from Github.
* 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).

dd-b

This was the thread that most resembled what I was worried about (found by Google search), but I didn't look at where it was placed in the hierarchy, yeah, I see it's not really the right place. Still, people seem to have seen it, so I won't at this point go start another thread also.

StarGeek

On the command line, you could use this command to copy the data.
exitool -@ xmp2iptc.args /path/to/files/

You can find similar args files to copy between groups on GitHub.
* 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).

dd-b

Yep, in the short run I'm going to be using something like that arguments file; either that one from the distro, or I'll make small mods if I run into issues with it interacting with some of my idiosyncratic uses of IPTC and XMP fields.

I've found a Piwigo plugin, now badly out of date, that lets it read XMP data as well as IPTC data, and the first layer of obvious problems running it in the current version of Piwigo are easily fixed (they mostly seem to be old code running into PHP changes and throwing warnings when they didn't used to). But forking it (it hasn't been updated in nearly a decade, the chance of the original author suddenly taking an interest again seems not something I should rely on) does leave me dealing with at least my own future problems with it, and to some extent other people's as well. (I could fork it and run my private copy but not share it, but that's not really how it's done!)

Yet another not ideal solution is to write a Perl script to move my rendered web-resolution versions of photos to the gallery server, and incorporate the metadata fixups there (so using the exif library in Perl rather than exiftool at the command line). There are other, file-naming issues I could handle there, which I'm currently handling manually, so that might be convenient.

(I had a 50 year career in software; I'm kind of used to my plans running into constraints in the tools environment every day or two. It still annoys me but it doesn't surprise me one bit.)