1
\$\begingroup\$

Not sure if this can be achieved with exiftool or if there's a better alternative...

I've exported a big amount of pictures from iPhoto and apparently apple exports original file with a sidecar XMP file including the details. The worst of this is the date of file, if you scan a picture 2020/01/01 and then you set its real creation date (let's say 1980/01/01), it will remain 2020/01/01 and reflect it as photoshop:DateCreated tag in the XMP file.

I'm wondering if there is any way to import this kind of information into the raw/jpeg/whatever file or if there is a way to import such information using lightroom.

Here is an example of XMP file:

<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.4.0">
   <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
      <rdf:Description rdf:about=""
            xmlns:exif="http://ns.adobe.com/exif/1.0/"
            xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/"
            xmlns:dc="http://purl.org/dc/elements/1.1/">
         <exif:GPSLongitudeRef>W</exif:GPSLongitudeRef>
         <exif:GPSTimeStamp>2019-12-22T01:02:42Z</exif:GPSTimeStamp>
         <exif:GPSLongitude>5.80</exif:GPSLongitude>
         <exif:GPSLatitude>45.20</exif:GPSLatitude>
         <exif:GPSLatitudeRef>N</exif:GPSLatitudeRef>
         <exif:GPSHPositioningError>0.0</exif:GPSHPositioningError>
         <photoshop:DateCreated>1980-01-01T12:11:19+02:00</photoshop:DateCreated>
         <dc:subject>
            <rdf:Seq>
               <rdf:li>old</rdf:li>
               <rdf:li>Mom</rdf:li>
            </rdf:Seq>
         </dc:subject>
      </rdf:Description>
   </rdf:RDF>
</x:xmpmeta>

Any ideas are welcome, thanks in advance.

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

See exiftool's Metadata Sidecar Files example #15

The command needs to be altered a bit due to some irregularities in the XMP sample you give. The best thing to do would be to grab the xmp2exif.args file and place that in the same directory as exiftool. This will allow tags in the XMP file to be copied to the correct place in the EXIF group.

Now, there's a problem with the XMP you list and that is the existence of GPSLatitudeRef/GPSLongitudeRef. These tags is not part of the Exif 2.31 metadata for XMP specification, which covers the GPS tags for XMP. The reference directions (North/South/East/West) are supposed to be included in the XMP GPSLatitude/GPSLongitude tags. So this needs to be explicitly addressed.

So your command would be along these lines:
exiftool -ext EXT -tagsfromfile %d%f.xmp -@ xmp2exif.args -GPSLatitudeRef -GPSLongitudeRef -r DIR

The command needs the inclusion of the -ext (extension) option to avoid processing the XMP files themselves. You would either include an -ext for each possible filetype, or you could use --ext xmp (two dashes) to exclude the xmp files.

This command creates backup files. Add -overwrite_original to suppress the creation of backup files. Add -r to recurse into subdirectories.

\$\endgroup\$
3
  • \$\begingroup\$ Thanks a lot for your detailed answer. Anyway, I'm trying to run it in a sample dir and I'm always getting: 1 directories scanned 0 image files read And I have 4 images with 4 xmp files, so I guess I'm missing something... \$\endgroup\$
    – zapico
    Commented Jan 12, 2020 at 19:18
  • \$\begingroup\$ Are you replacing EXT with the extensions of the file types to process? Or using --ext XMP (two dashes to indicate excluding that extension)? You need to use one or the other in order to prevent exiftool from trying to copy data from the XMP file to the same XMP file. \$\endgroup\$
    – StarGeek
    Commented Jan 12, 2020 at 19:32
  • \$\begingroup\$ Thanks a lot, I was setting -ext XMP and that was the whole problem :) \$\endgroup\$
    – zapico
    Commented Jan 12, 2020 at 19:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.