0

I have a bunch of image files of scanned slides with valid Exif timestamps for when the slide was taken (DateTimeOriginal tag) and when it was scanned into digital form (CreateDate tag, aka DateTimeDigitized). I can copy the Exif data into the corresponding IPTC and XMP groups like this:

exiftool -use MWG -DateTimeOriginal<exif:DateTimeOriginal -CreateDate<exif:CreateDate imagefile.jpg

This works for most image files. However, it seems that if the image file lacks IPTC metadata, the command above doesn't write the IPTC fields. I think I read somewhere that ExifTool won't create an IPTC section in files that don't already have one, but I'm hoping that's a default I can override with a command line option or something similar. Is there?

1 Answer 1

1

With regards to the MWG tags, you are correct in that exiftool will not create IPTC IIM/Legacy tags (not to be confused with IPTC Core/Ext tags, which are XMP) if there are no previous IPTC tags. See the last line of the 3rd paragraph of that link. This only happens when the MWG tags are used. Any other time, IPTC tags are second in the preferred location list. See second paragraph under the -TAG[+-^]=[VALUE] option.

You can override this by including any IPTC tag in the command. For example, you can set -ApplicationRecordVersion=4, which is the value that exiftool will set that tag anyway when an IPTC block is created.

4
  • I tried adding -ApplicationRecordVersion=4 to the command, but it didn't cause an IPTC section to be created. Ditto for -IPTCDigest=new. I tried them both at the beginning and at the end of the list of options. Running exiftool -ApplicationRecordVersion=4 imagefile.jpg by itself and then following it with the command in my OP work, but running exiftool -IPTCDigest=new imagefile.jpg first and then running the command in my OP did not. Dec 30, 2021 at 2:16
  • What version of exiftool are you using? exiftool -ver I double checked and I did make a mistake with IPTCDigest but when I used exiftool -ApplicationRecordVersion=4 -use MWG "-DateTimeOriginal<exif:DateTimeOriginal" "-CreateDate<exif:CreateDate" Test.jpg the IPTC data was created for me using ver 12.37.
    – StarGeek
    Dec 30, 2021 at 3:06
  • Yes, that works. I didn't use any quotes. I'm running version 12.38 on Windows 10 in PowerShell. Do you happen to know why the quotes are important? Dec 30, 2021 at 5:15
  • It is needed to prevent file redirection. In most command lines, the less than </greater than > signs are used redirect output to a file or input from a file. The quotes are needed so that the command line doesn't see the redirection and passes them to the program. Also, since you are using PS, you want to use single quotes around the options. It doesn't affect this command but if you try other exiftool commands, particularly ones that include a dollar sign, you must use single quotes. So it's a good habit to get into.
    – StarGeek
    Dec 30, 2021 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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