Problem with Xmp-iptcExt metadata

Started by Bernardd, March 08, 2012, 12:05:53 PM

Previous topic - Next topic

Bernardd

Hi Bogdan,

I use ExifTool 8.8.0 and ExifToolGui v5.7.0.0

I have tagged a picture with:

xmp-iptcExt:LocationShownCountryName
xmp-iptcExt:LocationShownCountryCode
xmp-iptcExt:LocationShownProvinceState
xmp-iptcExt:LocationShownCity
xmp-iptcExt:LocationShownSublocation

I can see for my picture on ExifToolGui one section XMP-iptcExt with all
item written.

I can see for my picture with Xnview v1.98.7 these tags in one section named Iptc4xmpExt

I have written a args file with this lines :
-IPTC:Country-PrimaryLocationName < XMP-iptcExt:LocationShownCountryName
-IPTC:Country-PrimaryLocationCode < XMP-iptcExt:LocationShownCountryCode
-IPTC:Province-State < XMP-iptcExt:LocationShownProvinceState
-IPTC:City < XMP-iptcExt:LocationShownCity
-IPTC:Sub-location < XMP-iptcExt:LocationShownSublocation

But something is not good, none write execute, but what ?

If i use mode ExifTool direct of ExifToolGui with this command line
"-IPTC:City < XMP-iptcExt:LocationShownCity"

I get this error message

1 image files read
    1 files could not be read
Error opening directory <
File not found: XMP-iptcExt:LocationShownCity
<-END-

Do know why ?

Thank you

BogdanH

Hi Bernard,

Xmp:LocationShown tags can contain multiple values; that is, they behave similar to i.e. keywords tag. If you take a look here:
http://www.exiftool.org/TagNames/XMP.html#iptcExt
..here, fur such tags, Phil added a plus sign in "Writable" column. For example:
LocationShownCity  string_+
.. I explain that in case similar "problem" appears in future.

However, Iptc:City is normal string tag (which can't hold multiple values). To transfer such multi-value tag content to regular tag, you need to use --struct option which (in your case) is:
--struct -Iptc:City<XMP-iptcExt:LocationShownCity

Btw. I've also learned this few days ago  :)

Bogdan

Phil Harvey

Hi Bogdan,

Thanks for answering.  I saw this:

Quote from: Bernardd on March 08, 2012, 12:05:53 PM
Error opening directory <
File not found: XMP-iptcExt:LocationShownCity
<-END-

and thought it was something about with the way the exiftool direct command line was parsed.  But I should have picked up on the first problem:

Quote from: BogdanH on March 08, 2012, 02:55:46 PM
Xmp:LocationShown tags can contain multiple values; that is, they behave similar to i.e. keywords tag. If you take a look here:
http://www.exiftool.org/TagNames/XMP.html#iptcExt
..here, fur such tags, Phil added a plus sign in "Writable" column. For example:
LocationShownCity  string_+
.. I explain that in case similar "problem" appears in future.

However, Iptc:City is normal string tag (which can't hold multiple values). To transfer such multi-value tag content to regular tag, you need to use --struct option which (in your case) is:
--struct -Iptc:City<XMP-iptcExt:LocationShownCity

Close.  It is the underline ("_") after the string that is significant.  Not the plus sign ("+").

The underline indicates a flattened tag name, which is not defined by default when copying.

This has come up a few times recently.  I wish there were another way around this, but I made the decision to enable the -struct feature by default when copying to preserve the structure of the information when copying all metadata.  Unfortunately the side-effect is that the flattened tags are no longer accessible for copying individually unless this feature is disabled.

- 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

Hi Phil,

I was hoping you will join here. From my side, it was more guess (than understanding) about  meaning of plus sign in this case. Probably because, from users perspective, i.e. Xmp:LocationShownCity and Xmp:Subject have very similar characteristics. Taking a look into resulting XMP file shows difference and explains presence of underline, of course.

Bogdan

Phil Harvey

I have been thinking about this.  Perhaps there is a way I can allow copying of either flattened or structured tags at the same time.  It will be sneaky, but maybe possible.  I'll look into it.  It would require extracting both structures and flattened tags when copying, but writing only structures by default, which could be done by effectively flagging the flattened tags as "unsafe" when copying.  If it works, this would be cool.

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

Bernardd

Hi Bodgan

Thank for you answer. The command "--struct -Iptc:City<XMP-iptcExt:LocationShownCity" is ok  in ExifTool direct. The IPTC data city is well written
from XMP-iptcExt:LocationShownCity data.

With you answer, i have found a singular rule. In args file you can write space before and after the character "<",
i e "-IPTC:By-line < XMP-dc:Creator" (line copied from xmp2iptc.args). But in ExifTool direct panel you must write without space, if no you get this
error message
    1 image files read
    1 files could not be read
Error opening directory <
File not found: XMP-dc:Creator
<-END-

The before space give the error opening directory. The after space give the file not found.

For memory in my last post, if i had written without space "-IPTC:City < XMP-iptcExt:LocationShownCity", i should have this error message
    0 image files updated
    1 image files unchanged
Warning: No writable tags set from ./victor sydney 2.jpg
<-END-

For use structured tags with Args file, i have find this below process :

Edit a Args file with structured tags like ie (all kind of tag and more one metadata section copy destination)

-IPTC:TimeCreated < XMP-photoshop:DateCreated
-IPTC:By-lineTitle < XMP-photoshop:AuthorsPosition
-IPTC:By-line < XMP-dc:Creator
-EXIF:Artist < XMP-dc:Creator
-IPTC:CopyrightNotice < XMP-dc:Rights
-EXIF:Copyright < XMP-dc:Rights

-IPTC:Country-PrimaryLocationName < XMP-iptcExt:LocationShownCountryName
-IPTC:Country-PrimaryLocationCode < XMP-iptcExt:LocationShownCountryCode
-IPTC:Province-State < XMP-iptcExt:LocationShownProvinceState
-IPTC:City < XMP-iptcExt:LocationShownCity
-IPTC:Sub-location < XMP-iptcExt:LocationShownSublocation

In ExifTool Direct panel type command -@ my_file.args --struct -xmp:all

Are they other ways ?

Thank Phil Harvey for your explanations. Well done for ExifTool.

Thank you

Bernard

Phil Harvey

Hi Bernard,

About -xmp:all in your command:  This will copy all XMP to itself, but may change the associations in the structures because it is being copied with --struct.

I would drop this from the command.  It doesn't make sense anyway if you are copying within the same file.

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

Bernardd

Hi Phil,

I understand the structure problem, but it is unreal for me, it is very above my know.

My intention is to only comment Xmp metadata, et after for each picture files to copy Xmp data to Iptc data, because for this day, Piwigo, a photo gallery software for the web (http://piwigo.org/) do not manage xmp metadatas.

Bernard

Phil Harvey

Hi Bernard,

OK, great.  Since you only want to copy XMP to IPTC, you don't need the -xmp:all argument.  So remove that from your exiftool direct command and you should be good to go.

- 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

Quote from: Phil Harvey on March 09, 2012, 07:20:05 AM
I have been thinking about this.  Perhaps there is a way I can allow copying of either flattened or structured tags at the same time....  If it works, this would be cool.

Yes, because user (not knowning Xmp internal stuff) might wonder: for moving i.e. LocationShownCity to Subject, --struct option is needed. However, for moving in opposite direction (Subject to LocationShownCity), no additional option is needed. If I move LocationShownCity to LocationShownCountryName, --struct is needed again. Can be confusing... and hard to remember.

@Bernard
Because there are no spaces in
-Iptc:City<XMP-iptcExt:LocationShownCity
..ExifTool will treat it as single command. If there are spaces, command must be quoted to be recognized as single command. In args file, spaces are allowed without quotes, because each line is only one command anyway.

Bogdan

Bernardd

Hi

My problem is resolved. Thank you very much

Bernard

Phil Harvey

@Bernard

Excellent! :)

@Bogdan

I have a test version of 8.82 running now with this new feature.  The logic is really quite complex, but should at least avoid the confusion that has been a problem recently.  The default behaviour will be that tags are copied as structures (same as before), but flattened tags may now be specified individually.  Just as before, --struct may used to copy only flattened tags, or -struct may be used to copy only as structures.

Since this is a fairly complex change, it is a good thing that I'll have a week or so to test it out before it is released.

- 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

Hi Phil,
I believe, that IptcExt tags could become used more and more in the future. Right now, there's no hurry -so, take all the time you need.

Bogdan

Phil Harvey

Update:  As of ExifTool 8.83, you no longer need to use the --struct option to copy flattened tags by name.

This was a cool improvement.  I wish I thought of it earlier.  A very smart idea that was made possible by ExifTool's "unsafe" tag feature.

- 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

Hi Phil,

Thank you for pointing out this improvement here. Btw. ExifTool for Windows download is still at v8.80  ???

Bogdan