write filename without extension to XMP:Description

Started by Archive, May 12, 2010, 08:54:20 AM

Previous topic - Next topic

Archive

[Originally posted by heiko on 2008-04-23 10:04:08-07]

Hello,

I like to write the filename without the file extension to XMP:Description

ExifTool -XMP:Description&ltFileName *.*

writes the complete name into the description field (with extension)

ExifTool -XMP:Description&lt%f *.*

writes the string '%f' into the description field.

What I'm doing wrong??

Regards
Heiko

Archive

[Originally posted by exiftool on 2008-04-23 10:54:19-07]

Hi Heiko,

You can only use %f, %d and %e where a filename would be expected,
so they can't be used to set the description.  Instead, you must use
a command like this:

Code:
exiftool "-xmp:Description<filename" *.*

but this command will also write the file extension.  If you don't want
the extension, you must create a user-defined tag to strip it off.
Luckily, this is one of the example tags defined in the
https://exiftool.org/config.html" target="_blank">sample
config file.  So after installing the config file, you have a new
"basename" tag which can be used to do what you want:

Code:
exiftool "-xmp:Description<basename" *.*

Also, I would recommend using "." (the current directory) instead of
"*.*" (all files in the current directory), because then exiftool won't
try to process files with unknown extensions (and subdirectories
containing a "." in the name).

- Phil

Archive

[Originally posted by heiko on 2008-04-23 11:43:53-07]

Hello Phil,

thank you for your quick answer. I've searched in the whole documentation, but have not thought at the .exiftool_config file. Now it works without any problems.

The *.* was an example; in a real case I won't call ExifTool with *.*

Thanks a lot
Heiko