MPF segments are not editable by ExifTool, but how to just remove them?

Started by xwindows, January 24, 2022, 06:56:49 AM

Previous topic - Next topic

xwindows

I have a moderate number of photos I took (300-ish JPEG images) that I would like to remove all metadata except manufacturer-independent ones specified by EXIF before giving them out. The photos contain EXIF (including manufacturer-specific maker notes), Epson PrintIM, and CIPA MPF metadata. There were not too much problem operating ExifTool to deal with the most of these, except for the following issue...

This page said ExifTool doesn't allow modification of MPF metadata, but allows deletion by using identifier "MPF:All" and "Trailer:All". So, I tried the following:

$ exiftool -MPF:All= -Trailer:All= -overwrite_original photo.jpg
Warning: Not a deletable group: MPF
    1 image files updated
$


From the output, ExifTool still insisted that MPF metadata were not writable- and also refused to strip them on that ground, as shown in a subsequent sanity check:

$ exiftool -MPF:All -G photo.jpg
[MPF]           MPF Version                     : 0100
[MPF]           Number Of Images                : 2
[MPF]           MP Image Flags                  : Dependent child image
[MPF]           MP Image Format                 : JPEG
[MPF]           MP Image Type                   : Large Thumbnail (full HD equivalent)
[MPF]           MP Image Length                 : 535050
[MPF]           MP Image Start                  : 2977792
[MPF]           Dependent Image 1 Entry Number  : 0
[MPF]           Dependent Image 2 Entry Number  : 0
$


The question is what is a proper way to strip off (not modify, just delete) the CIPA MPF metadata segments by using ExifTool? (That is, without resorting to a strip-all first re-inject later workaround as written below)

ExifTool: 8.60 (Debian)
System: Debian GNU/Linux 7.0 "Wheezy" i386

P.S. Currently, I have resorted to the following workaround:

  • Back up all photos in the set
  • Remove all the metadata from every photos in the set:

    exiftool -All= -overwrite_original *.jpg

  • For each photo in the set: reload metadata from the corresponding backup file, but filter for only EXIF (and exclude unwanted manufacturer-dependent baggage):

    exiftool -tagsFromFile /path/to/backupNNN.jpg -EXIF:All -x MakerNotes -x PrintIM -overwrite_original originalNNN.jpg

    (^ /path/to/backupNNN.jpg and originalNNN.jpg are written here as placeholders of shell script variables that correspond to backup file path and filename respectively)
I actually had to write a shell script to do step 3; and apart from that, the workaround is still convoluted and required a lot of disk space which I don't always have; so the straightforward way is preferred (which wouldn't require a use of shell script in the first place).

Phil Harvey

Quote from: xwindows on January 24, 2022, 06:56:49 AM
$ exiftool -MPF:All= -Trailer:All= -overwrite_original photo.jpg
Warning: Not a deletable group: MPF
    1 image files updated
$

Update your version of ExifTool.

It is hard to believe, but your version is more than 10 years out of date.  :(

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

xwindows

Quote from: Phil Harvey on January 24, 2022, 08:04:14 AMUpdate your version of ExifTool.

With this, I have fished a newer (but for Windows) version from my backup archive to at least temporarily get through this problem. It worked:
$ wine exiftool.exe -ver
9.20
$ wine exiftool.exe -MPF:All= -Trailer:All= -overwrite_original photo.jpg
    1 image files updated
$ wine exiftool.exe -MPF:All -G photo.jpg
$


And finally (as a record for anyone else reading) the full command line I used with multiple-photos set was as following, which I verified that it succeeded doing what I originally set out to do:
$ wine exiftool.exe -MakerNotes= -PrintIM= -MPF:All= -Trailer:All= -overwrite_original *.jpg
   19 image files updated
$


(A closer look at the changelog revealed that the MPF removal function was added in 9.14; so this ExifTool-version V.S. MPF tag caveat will definitely go into my notes)

Thank you for your time, and for identifying the cause of the problem so quickly.

ExifTool: 9.20 (win32 binary)
WINE: 1.6.2 (source, set to Windows XP-compatible)
System: Debian GNU/Linux 7.0 "Wheezy" i386

Phil Harvey

Version 9.20 is still 9 years old.  You can download the most current version from the ExifTool home page.

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