Confused about the "-m" option

Started by Tarn, March 02, 2013, 12:15:40 AM

Previous topic - Next topic

Tarn

  I understand that the "-m" allows me to write data to a tag despite minor errors or warnings. But it seems that it will, also, correct some errors... is that right?

  I had three files: _7108248.jpg; _7108249.jpg; and _7108285.jpg, that the
command: -Warning .
produced: "[minor] Bad format (7052) for CameraSettings entry 0"
message for these files.

The command: -UserComment"<$Filename" -P -overwright_original .
produced: "Warning: [minor] Bad format (7052) for CameraSettings entry 0 - ./_7108248.JPG
                  Error: [minor] Bad format (7052) for MakerNotes entry 0 - ./7108248.JPG"
and so on for all three files. The end result was the three Warnings, the three error messages, and "0 image files updated" and "3 files weren't updated due to errors". However,
the command: -UserComment"<$Filename" -P -overwright_original . -m (adding "-m" to the end)
produced: "Warning: Bad format (7052) for MakerNotes entry 0 - ./-7108248.JPG"
and so on for all three files. With the end result being "3 image files updated"

  I understand that the "-m" will allow me to write to the UserComment tag despite the error, that's not the problem. What I don't understand is why the Warning tag is empty after that. In fact, the Warning tag does not seem to even exist in the file afterwards. I'm not looking a gift horse in the mouth, and I am very grateful that this happens. I am just trying to understand what is happening with the "-m" option.

  I wrote a batch file to put the Filename into UserComments, and re-name the file to the original date, plus the last four digits (picture number) of the original file name. The original error stops it cold; nothing gets updated. Simply adding "-m" to the end of the code lets both functions happen.
Original batch file:
-UserComment"<$Filename" -d %%y%%m%%d-%%%%-4f.%%%%e -Filename"<$DateTimeOriginal" -overwrite_original --ext .db * -progress
Modified batch file:
-UserComment"<$Filename" -d %%y%%m%%d-%%%%-4f.%%%%e -Filename"<$DateTimeOriginal" -overwrite_original --ext .db * -progress -m
  The original batch file fails, yet the modified batch file not only works, but seems to correct the problem.

  Would it be correct to assume that having the "-m" option in all processing would be a worthwhile thing? Or could that cause problems with files that have do not have problems to begin with? In other words, should I include "-m" in any command line, or batch file that I use to write data to files?



 


Phil Harvey

You're right, I don't think that I have documented this well.  ExifTool will always attempt to fix any problems that it can when rewriting an image, and it will issue an error and not write the image if it doesn't know how to fix the problem.  Minor errors occur with less critical problems, and with these you have the option to force ExifTool to write the image anyway.  When you ignore a minor error, 4 things can happen:

1) ExifTool repairs the damage successfully.

2) ExifTool attempts to repair the damage, but isn't successful and the information is corrupted.

3) ExifTool drops the corrupted information, and it is lost forever.

4) ExifTool rewrites the corrupted information as-is.

For points 1, 2 and 3, the warning message will likely disappear when reading the image back again.  If you use the -v option you may see more details about how ExifTool dealt with the particular problem.  For a bad 0th entry in an IFD, ExifTool will likely assume the entire IFD is bad and drop the whole thing, which would result in the loss of any information in that IFD (but it may already be lost).

Many people use -m routinely, and I haven't heard any complaints.  Usually when information is lost it is information that other applications can't read anyway.  If any standard information is corrupted, the error will usually not be minor.

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

Tarn

Great! Thanks.

Now, in the case where all IFD info is dropped. If some of the information that was lost was important to me, and I wanted it back, could I use tagsfromfile to pick out and replace the information that I needed? Or would the tags, in the new file, be missing?

Phil Harvey

ExifTool shouldn't drop an IFD if there is any information that it can extract from it, so the -tagsFromFile option won't help here.

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