ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: xwindows on January 24, 2022, 06:56:49 AM

Title: MPF segments are not editable by ExifTool, but how to just remove them?
Post by: xwindows on January 24, 2022, 06:56:49 AM
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 (http://exiftool.sourceforge.net/TagNames/MPF.html) 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:
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).
Title: Re: MPF segments are not editable by ExifTool, but how to just remove them?
Post by: Phil Harvey on January 24, 2022, 08:04:14 AM
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
Title: Re: MPF segments are not editable by ExifTool, but how to just remove them?
Post by: xwindows on January 26, 2022, 04:45:46 AM
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 (http://exiftool.sourceforge.net/ancient_history.html#v9.14) 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
Title: Re: MPF segments are not editable by ExifTool, but how to just remove them?
Post by: Phil Harvey on January 26, 2022, 07:11:30 AM
Version 9.20 is still 9 years old.  You can download the most current version from the ExifTool home page (https://exiftool.org).

- Phil