XMP metadata appending rather than overwriting

Started by jhaneyzz, September 12, 2013, 11:39:12 AM

Previous topic - Next topic

jhaneyzz

OK Phil,

You got me out of the woods yesterday, I hope you can get me all the way home today.
I am successfully writing metadata to my custom XMP fields.

However, in the example below, the first field (myxmpDisplayName) is a simple string value field.
The second field (myxmpFormNumber), is a bag container.

When I run the following two commands, one after the other.

exiftool -config "/Users/jhaneyzz/.ExifTool.config" -v4 -overwrite_original_in_place -myxmpDisplayName='Use This file as an example' -myxmpFormNumber='FN 111' "/Volumes/crx.default/content/dam/Client1/testing_folder/xmp test_original_in_place.pdf"


exiftool -config "/Users/jhaneyzz/.ExifTool.config" -v4 -overwrite_original_in_place -myxmpDisplayName='New Display Name' -myxmpFormNumber='FN 7756' "/Volumes/crx.default/content/dam/Client1/testing_folder/xmp test_original_in_place.pdf"

I end up with:


myxmpDisplayName: New Display Name
myxmpFormNumber: FN 111,FN 7756


The command is APPENDING to the bag container, and in this instance I need to REPLACE the entire contents of the myxmpFormNumber field with a new value or list of values.

Any guidance?






Phil Harvey

Something is going wrong.  The list should only be appended if you use += instead of =.  I may be able to figure this out if you attach your config file so I can give it a try.

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

jhaneyzz


Here is my config file.



##
print "Custom ExifTool config loaded!\n";
%Image::ExifTool::UserDefined = (
    # XMP tags may be added to existing namespaces:
    'Image::ExifTool::XMP::xmp' => {
        myxmpTitle => { Writable => 'lang-alt' },
        myxmpDisplayName => { Writable => 'lang-alt' },
        myxmpDescription => { Writable => 'lang-alt' },
        myxmpDocumentType => { Writable => 'lang-alt' },
        myxmpPIRnumber=> { List => 'Bag' },
        myxmpFormNumber => { List => 'Bag' },
        myxmpBuildingEnvironment => { List => 'Bag' },
    },
);
1; #end

Phil Harvey

This works fine.  Try it again on a fresh PDF 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 ($).

jhaneyzz

You are absolutely correct.

ExifTool (as usual) is doing the right thing.

You know what's happening though?

When Adobe CQ notices the file change and extracts the new metadata, it is appending it in the CQ record!!!

Man... It's always something.