GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||
GeezerVison is showing exiftool.org — Metadata Sidecar Files Metadata Sidecar FilesMetadata for images and other file types may be stored in a separate metadata file. These are the only files that exiftool can create from scratch. A common example of this is the XMP "sidecar" file (which is discussed in the next section in some detail). Other supported metadata file types are EXIF, MIE, EXV, ICC and VRD. As well, ExifTool supports XML-format output, which can also be used to generate metadata sidecar files. XMP Sidecar FilesThere are a number of different ways to generate an XMP sidecar file with exiftool, and the method you choose depends on your circumstances and preferences. Below are a number of example commands which write an output XMP file from information in a source file of any type. 1. Copy same-named tags from all information types to preferred locations in XMP: ( exiftool -tagsfromfile SRC.EXT DST.xmp 2. Rewrite source file to destination XMP file: (same effect as above, but the command will exit with an error if the output XMP file already exists) exiftool SRC.EXT -o DST.xmp 3. Copy XMP, preserving original locations: (ie. copies XMP tags only to the same namespaces in the destination file) exiftool -tagsfromfile SRC.EXT -all:all DST.xmp Advanced: Notice that 4. Rewrite source to XMP file, preserving locations: (same effect as above, but the command will fail if the XMP file already exists) exiftool SRC.EXT -o DST.xmp -all:all 5. Generate XMP from EXIF and IPTC using standard tag name mappings: (the exiftool -tagsfromfile SRC.EXT -@ exif2xmp.args -@ iptc2xmp.args DST.xmp 6. Copy XMP as a block to an XMP file: (writing as a block is the only way to transfer unknown or non-writable XMP tags) exiftool -tagsfromfile SRC.EXT -xmp DST.xmp Note that this will not deal with extended XMP segments in JPEG images if they exist. 7. Extract XMP as a block and write to output XMP file: (same effect as above) exiftool -xmp -b SRC.EXT > DST.xmp As with the previous command, this command will not copy extended XMP
segments in JPEG images, but in this case the 8. Extract XMP as a block to an output text file with .xmp extension: (same effect as above, but the destination file name will be the same as the source file, and this command will fail if the XMP file exists while the previous command will overwrite an existing file) exiftool -xmp -b -w xmp SRC.EXT The advantage of this command is that it may be applied to multiple source files or entire directories. 9. Restore all XMP tags from an XMP sidecar file to XMP in a JPG image: exiftool -tagsfromfile SRC.xmp -all:all DST.jpg 10. Restore XMP as a block from an XMP sidecar file to a JPG image: (same effect as above except that any non-writable XMP tags would be copied by this command, and the 2 kB of padding recommended by the XMP specification is not added when copying as a block) exiftool -tagsfromfile SRC.xmp -xmp DST.jpg or equivalently exiftool "-xmp<=SRC.xmp" DST.jpg Batch ProcessingMultiple files may be processed in a single command by specifying multiple file and/or directory names on the command line. The examples below demonstrate how to process all files with a specific extension in an entire directory tree. 11. Create XMP sidecar files for all files with extension EXT in a directory tree: (when batch-generating sidecar files from many images, the exiftool -ext EXT -o %d%f.xmp -r DIR where 12. Copy tags to sidecar files that already exist: (same as above, but copies only to existing XMP files) exiftool -ext xmp -tagsfromfile %d%f.EXT -r DIR This command will add tags from the source files to information that
already exists in the XMP files, but note that this command searches for the XMP
files instead of the image files, so it will not generate new XMP sidecar files
if some images don't have them. For this, the advanced (ie. tricky and
confusing to use) 13. Copy tags to sidecar files, generating new files if necessary: (same as above, but also creates new XMP files if they don't exist) exiftool -ext EXT -tagsfromfile @ -srcfile %d%f.xmp -r DIR Note that as with the previous two commands, this command will commute metadata from other groups to the preferred location in XMP. 14. Copy only XMP tags to the same namespace in sidecar files: (same as above, but copies only XMP and preserves specific tag locations) exiftool -ext EXT -tagsfromfile @ "-all:all<xmp:all" -srcfile %d%f.xmp -r DIR In this command, if " 15. Copy XMP from sidecar files back to the same locations in the source files: (the inverse of the previous command) exiftool -ext EXT -tagsfromfile %d%f.xmp -all:all -r DIR Here,
16. Write a tag to XMP sidecar if it exists, or the original file otherwise: exiftool -ext EXT -artist="Phil" -srcfile %d%f.xmp -srcfile @ DIR When multiple 17. Create XMP sidecar file in another directory: exiftool -ext EXT -o DSTDIR/%f.xmp -r SRCDIR By specifying a directory name instead of Via the APIBy specifying different tags in the SetNewValuesFromFile call, the above examples numbered 1-6 are programmed like this:
and examples 7 and 8 use this general technique:
ExifTool XML FilesClosely related to the XMP sidecar file is the XML file written using the
exiftool Create an exiftool XML sidecar file: exiftool -X a.jpg > a.xml Restore original meta information from exiftool XML file: exiftool -tagsfromfile a.xml -all:all a.jpg The exiftool -X -b -makernotes -all a.jpg > a.xml Note that we needed to add Via the APIThere is no way to automatically produce a sidecar exiftool XML file via the
API since this function is accomplished with an output formatting option of the
exiftool application. However, the API may be used to read and copy tags
from an exiftool XML file just like any other file format. When reading
ExifTool XML files, all tags except those in the EXIF FilesEXIF files store EXIF information in the same TIFF-based format as the EXIF
APP1 segment of a JPEG image, but without the "Exif\0\0" header. The three
commands below illustrate techniques for copying the entire EXIF block from a
source image ( exiftool -exif -b SRCFILE > out.exif exiftool -tagsfromfile SRCFILE -exif out.exif exiftool -o out.exif -exif SRCFILE The Extra EXIF tag used in each of the
above commands (the " Tags may also be copied individually to and from an EXIF file, but remember that this will not copy "unsafe" tags unless they are specified explicitly. The following command creates an EXIF file from the metadata in a source file: exiftool -o out.exif -all -unsafe SRCFILE This technique works for any type of source file, provided the file contains at least one tag with the same name as an EXIF tag. Below is an example of how to apply this to all files in a directory: exiftool -o %d%f.exif -all -unsafe DIR MIE FilesThe MIE file format allows storage of native binary meta information, and is the best option for saving metadata from a file in its original format. Here are two examples that copy all individual tags plus the ICC Profile to a MIE sidecar file: exiftool -tagsfromfile a.jpg -all:all -icc_profile a.mie exiftool -o a.mie -all:all -icc_profile a.jpg And the following command performs the inverse operation, restoring metadata in a JPG image from a MIE file: exiftool -tagsfromfile a.mie -all:all -icc_profile a.jpg Information can also be copied in block form to a MIE file. This allows preservation of the original data structure as well as unknown and non-writable tags. The command below copies the full EXIF segment as a block from a JPEG image, exiftool -tagsfromfile a.jpg -exif a.mie which is functionally different from copying all writable EXIF tags individually with a command more like this exiftool -tagsfromfile a.jpg -exif:all a.mie Block-writable tags are listed in the Extra Tags documentation. MIE files also have the ability to store information in compressed format with
the EXV FilesEXV files are used by Exiv2, and are basically a JPEG file without the image data, so they may be used as a metadata file to contain any information supported by the JPEG format (EXIF, XMP, IPTC, etc.). ExifTool has full read, write and create support for this format. Created Nov 12, 2008 Last revised July 31, 2019 | ||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |