Is it possible to write a custom XMP value? For example, I try:
exiftool -xmp-MyNameSpace:MyFieldOne=Client11 "080616_069672 Paestum.dng" -overwrite_original -k
But that returns the message "Tag MyFieldOne does not exist"
Any thoughts?
John
Hi John,
See the sample config file (https://exiftool.org/config.html) for details about how to add user-defined tags.
- Phil
Thanks Phil
I've pretty well worked that out now.
Is there any good reason why the config file should begin with a "." ? It seems to make the file invisible on Mac, and being forced to rename a file through the shell on a script is, well, bizarre.
John
Hi John,
The idea is that the file is invisible in your home directory. This is a common Unix thing. Each user typically has a number of files like this to configure various applications, and it is nice that they are invisible so they don't clutter up your home directory.
But if you are willing to use the -config option, you can call it whatever you want.
- Phil
Thanks Phil - I had noticed the -config switch but hadn't thought about using it to allow the file to be visible. I find it equally irritating that .htaccess in hidden on Mac too.
John
Hi John,
As Phil mentioned this has long been a "normal" thing with Unix and it is not a big deal when working on the unix command line since ls -a will reveal all the hidden "." dot files.
I also find it annoying that Finder does not give you a way to also enable seeing these files. There are a couple of freeware/shareware file browsers, the names of which I don't recall, that to have the ability to show you dot files. I have played with them but usually is too much a hassle to go fire them up on the infrequent occasion that I might need too. It is usually easier (for me anyway) to start terminal the us the native Unix commands.
There is a work around that I occasionally use but it also requires using Terminal and a unix command. But the result is that the file is permanently visible to Finder and it doesn't change the default behavior of existing apps. Use the ln command to create a symbolic link (like an alias) to the dot file that finder will see.
QuickSilver-2{115}% ln -s .config dotconfig
From finder you will now see dotconfig.
Hope that helps.
-louie
PS I would be cautious about doing this to the .htaccess file since that is a security file and you probably don't want that visible to remote browsers.
I'm trying to do this but i do not get it to work. I have done this modifications to the config example file.
# This is a basic example of the definition for a new XMP namespace.
# This table is referenced through a SubDirectory tag definition
# in the %Image::ExifTool::UserDefined definition above.
# The namespace prefix for these tags is 'xxx', which corresponds to
# an ExifTool family 1 group name of 'XMP-xxx'.
%Image::ExifTool::UserDefined::xwnv = (
GROUPS => { 0 => 'XMP', 1 => 'XMP-xwnv', 2 => 'Image' },
NAMESPACE => { 'xwnv' => 'http://ns.xinet.com/ns/xinetschema#' },
WRITABLE => 'string',
XMP-xwnv:AM_Status
# - replace "NewXMPxxxTag1" with your own tag name (eg. "MyTag")
AM_Status => { Writable => 'lang-alt' },
# Example 9. XMP-xxx:NewXMPxxxTag2
NewXMPxxxTag2 => { Groups => { 2 => 'Author' } },
# Example 10. XMP-xxx:NewXMPxxxTag3
NewXMPxxxTag3 => { List => 'Bag' },
# Example 11. XMP-xxx:NewXMPxxxStruct
# - example structured XMP tag
NewXMPxxxStruct => {
# the "Struct" entry defines the structure fields
Struct => {
# optional namespace prefix and URI for structure fields
# (required only if different than NAMESPACE above)
NAMESPACE => { 'test' => 'http://x.y.z/test/' },
# optional structure name (used for warning messages only)
STRUCT_NAME => 'MyStruct',
# optional rdf:type property for the structure
TYPE => 'http://x.y.z/test/xystruct',
# structure fields (very similar to tag definitions)
X => { Writable => 'integer' },
Y => { Writable => 'integer' },
# a nested structure...
Things => {
List => 'Bag',
Struct => {
NAMESPACE => { thing => 'http://x.y.z/thing/' },
What => { },
Where => { },
},
},
},
List => 'Seq', # structures may also be elements of a list
},
My command looks like this, ("/usr/local/bin/exiftool -config /usr/local/bin/AM_Exif.config -XMP:AM_Status='" & AM_StatusValue & "' " & theImgPath & " -overwrite_original")
I'm running this from an apple script so the variables AM_StatusValue and theImgPath is exchanged to the correct values.
But i get this error message
syntax error at /usr/local/bin/AM_Exif.config line 248, near "xwnv:"
BEGIN not safe after errors--compilation aborted at /usr/local/bin/AM_Exif.config line 294.
Warning: Tag 'AM_Status' does not exist
Nothing to do
This is how these custom fields looks in Photoshop.
</xmpMM:History>
<xmpRights:Marked>False</xmpRights:Marked>
<xwnv:AM_Status>4 Reproklar</xwnv:AM_Status>
<xwnv:usage_locked>False</xwnv:usage_locked>
Any help would be appreciated, thanks in advance.
Is this the entire file? Because it's currently missing a closing paren and semicolon at the end. );
Quote from: StarGeek on May 24, 2016, 01:46:28 PM
Is this the entire file? Because it's currently missing a closing paren and semicolon at the end. );
Furthermore, the line
XMP-xwnv:AM_Status is erroneous. I can't check the precise form of the WRITABLE item at the moment, but my guess is that's where your problem started. So basically you got errors in your config file...
Quote from: StarGeek on May 24, 2016, 01:46:28 PM
Is this the entire file? Because it's currently missing a closing paren and semicolon at the end. );
No it is just a part of the sample file i found here, http://www.exiftool.org/config.html (http://www.exiftool.org/config.html)
I thought it was unnecessary to post the entire file.
Quote from: Hayo Baan on May 24, 2016, 01:50:45 PM
Quote from: StarGeek on May 24, 2016, 01:46:28 PM
Is this the entire file? Because it's currently missing a closing paren and semicolon at the end. );
Furthermore, the line XMP-xwnv:AM_Status is erroneous. I can't check the precise form of the WRITABLE item at the moment, but my guess is that's where your problem started. So basically you got errors in your config file...
What should this line be then? The sample file looks like this.
%Image::ExifTool::UserDefined::xxx = (
GROUPS => { 0 => 'XMP', 1 => 'XMP-xxx', 2 => 'Image' },
NAMESPACE => { 'xxx' => 'http://ns.myname.com/xxx/1.0/' },
WRITABLE => 'string',
# Example 8. XMP-xxx:NewXMPxxxTag1
# - replace "NewXMPxxxTag1" with your own tag name (eg. "MyTag")
NewXMPxxxTag1 => { Writable => 'lang-alt' },
# Example 9. XMP-xxx:NewXMPxxxTag2
NewXMPxxxTag2 => { Groups => { 2 => 'Author' } },
# Example 10. XMP-xxx:NewXMPxxxTag3
NewXMPxxxTag3 => { List => 'Bag' },
# Example 11. XMP-xxx:NewXMPxxxStruct
# - example structured XMP tag
NewXMPxxxStruct => {
# the "Struct" entry defines the structure fields
Struct => {
# optional namespace prefix and URI for structure fields
# (required only if different than NAMESPACE above)
NAMESPACE => { 'test' => 'http://x.y.z/test/' },
# optional structure name (used for warning messages only)
STRUCT_NAME => 'MyStruct',
# optional rdf:type property for the structure
TYPE => 'http://x.y.z/test/xystruct',
# structure fields (very similar to tag definitions)
X => { Writable => 'integer' },
Y => { Writable => 'integer' },
# a nested structure...
Things => {
List => 'Bag',
Struct => {
NAMESPACE => { thing => 'http://x.y.z/thing/' },
What => { },
Where => { },
},
},
},
List => 'Seq', # structures may also be elements of a list
},
So i removed the text # Example 8. and changed the tag to what is the name of the tag i want to write to. It looks like this in Photoshop, <xwnv:AM_Status>4 Reproklar</xwnv:AM_Status> Where xwnv:AM_Status is the name of the tag and "4 Reproklar" is its current value.
It looks like you misunderstood the way the comments are meant to be read. The comments are for the uncommented line directly following it, not for the line itself. So in your case leave the comments in, but change the relevant uncommented version of NewXMPxxxTagx with your tag (AM_Status) and then fill in appropriate value for its content. As your tag isn't a struct, you should leave out the Struct definition, the same goes for the other irrelevant definitions.
Quote from: Hayo Baan on May 25, 2016, 02:36:50 AM
It looks like you misunderstood the way the comments are meant to be read. The comments are for the uncommented line directly following it, not for the line itself. So in your case leave the comments in, but change the relevant uncommented version of NewXMPxxxTagx with your tag (AM_Status) and then fill in appropriate value for its content. As your tag isn't a struct, you should leave out the Struct definition, the same goes for the other irrelevant definitions.
Yes i have misunderstood that line, changed it back to "# Example 8. XMP-xwnv:AM_Status" and tried again with this result. "Warning: Tag 'AM_Status' does not exist Nothing to do."
Have you perhaps forgotten to define the namespace?
# new XMP namespaces (eg. xxx) must be added to the Main XMP table:
'Image::ExifTool::XMP::Main' => {
# namespace definition for examples 8 to 11
xxx => { # <-- must be the same as the NAMESPACE prefix
SubDirectory => {
TagTable => 'Image::ExifTool::UserDefined::xxx',
# (see the definition of this table below)
},
},
# add more user-defined XMP namespaces here...
},
(Sorry, can't be more specific as I am not at my computer at the moment)
Yes, that and changing my command line to "/usr/local/bin/exiftool -XMP:AM_Status+ -b " did the trick, i have written metadata to my custom field with exifTool.
Thank you for your help!!
Is it possible to write custom metadata flatter?
This is what it looks like in the file when written with exifTool.
<xwnv:AM_WebPaths>
<rdf:Alt>
<rdf:li xml:lang="x-default">True</rdf:li>
</rdf:Alt>
</xwnv:AM_WebPaths>
And this is how it looks when written with our file managing system.
<xwnv:AM_WebPaths>True</xwnv:AM_WebPaths>
Our file managing system accepts both ways fine, but when later reading this info in a third system i got issues with the ones written with exifTool.
My custom config looks like this.
%Image::ExifTool::UserDefined::xwnv = (
GROUPS => { 0 => 'XMP', 1 => 'XMP-xwnv', 2 => 'Image' },
NAMESPACE => { 'xwnv' => 'http://ns.xinet.com/ns/xinetschema#' },
WRITABLE => 'string',
# Example 8. XMP-xwnv:AM_Status
# - replace "NewXMPxxxTag1" with your own tag name (eg. "MyTag")
AM_Status => { Writable => 'lang-alt' },
# Example 9. XMP-xwnv:AM_WebPaths
AM_WebPaths => { Writable => 'lang-alt' },
# Example 10. XMP-xxx:NewXMPxxxTag3
Edit: Spellcheck
Remove the "Writable => 'lang-alt'".
- Phil
Quote from: Phil Harvey on June 27, 2016, 10:07:33 AM
Remove the "Writable => 'lang-alt'".
- Phil
Thank you Phil, works just fine.