Copy of all metadata from one image file to another one

Started by mws, July 19, 2011, 03:43:40 AM

Previous topic - Next topic

mws

I want to copy all metadata from image file to another one and tried (on a Windows PC):
exiftool -TagsFromFile srcimage.jpg targetimage.jpg

After extracting all metadata with ExifTool from the source image and the target image I found that a couple of metadata properties are missing in the target, e.g. dc:description and photoshop:DateCreated in the XMP packet.

By "all metadata" I mean metadata in the Exif header, in the IPTC-IIM header and in the XMP packet.

How to improve?

My use case is: I have to resize images to a specific maximum width, the tool I'm using for this purpose removes all XMP metadata - bad. My approach is now first to create a resized copy of the source image and then to transfer all metadata from the source to the resized target image.

Michael

Phil Harvey

#1
Hi Michael,

From the -tagsFromFile documentation:

           "By default, this option will commute information between same-
            named tags in different groups and write each tag to the preferred
            group.  This allows some information to be automatically trans-
            lated when copying between images of different formats.  However,
            if a group name is specified for a tag then the information is
            written to the original group (unless redirected to another group,
            see below).  This works even if "All" is used as a group name, so
            "-All:All" is used to specify that all information be copied to
            the same group in the destination file."


Let me know if this doesn't explain things.

- Phil

Edit: added link to -tagsFromFile documentation
...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 ($).

mws

Hi Phil
exiftool -TagsFromFile srcimage.jpg "-all:all>all:all" targetimage.jpg
has improved the transfer of metadata dramatically, the metadata export files in XML of about 30 kB are only 2 kB different and this may come from a really redundant overhead.

But it is not that easy to follow your concept of groups of tags - I have taken "-all:all>all:all" from one of the examples as the wildard "all" sounds promising -: on the homepage of the documentation I find a table of Tag Groups. Ok, and where to find the list of all tags pertaining to a group? Could the "Tag Names" table be a starting point, are the terms listed there the major group names? And where to find more about the APP* groups?

This leads to the question what exactly is identified by a group name? I feel it is a mix of how metadata properties are embedded - different APP headers, different sub strcuctures like Image Resource Blocks and different types of serializing a set of metadata like IPTC's IIM or Adobe's XMP, and RDF namespaces have a role as group name suffixes. Where to find a documentation for all of this?

Michael

Phil Harvey

Hi Michael,

The groups are not documented in detail, but they may be listed with the -listg# option, where # is the group family number.  But yes, the family 0 groups usually correspond to the major sections in the tag name documentation.  However, you can learn a lot by just looking at the group names for the files you are interested in.  I suggest -G0:1.

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

mws

Hi Phil,
if I use the -G0:1 I only see the metadata which are in fact a specific file which means one must have a test file with metadata included to find out the group names, but I cannot work from e.g. a written documentation about metadata properties applied to a file.

If the goal is to retrieve all Exif, all IPTC-IIM and all XMP metadata then EXIF:all, IPTC:all and XMP:all should be applied, is my guess right?

Michael

Phil Harvey

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