Python – Read Exif using Python : Possibly Corrupted Field Tag 0x0000 in MakerNote IFD

Read Exif using Python : Possibly Corrupted Field Tag 0x0000 in MakerNote IFD… here is a solution to the problem.

Read Exif using Python : Possibly Corrupted Field Tag 0x0000 in MakerNote IFD

I’m working on a project where I want to read metadata from .jpg images and write them to a file. I took some photos on the Olympus TG-4 and tried to read Exif data with Python 3.

My script says:

import exifread
f = open('P8110003. JPG', 'rb')
tags = exifread.process_file(f)

I get the message “Field marker 0x0000 may be corrupted in MakerNote IFD"
I’ve tried five different jpg files and they all produce the same message. I took pictures today – are they really all corrupt?

This does not return an error:

import PIL. Image
import PIL. ExifTags
img = PIL. Image.open('P8110003. JPG')
exif_data = img._getexif()

exif = {
    PIL. ExifTags.TAGS[k]: v
    for k, v in img._getexif().items()
    if k in PIL. ExifTags.TAGS
}

list(exif_data.values())
print(exif_data.values())

So I’m assuming the camera stores metadata in some proprietary format that Exifread doesn’t expect? I just want to read the metadata and store it in a text file and import it into the database. I guess reading it from the dictionary is a workable solution. It would be interesting if someone could shed light on why Exifread is not working.

Solution

I’m doing some small research due to similar issues. I know the problem is old, but maybe some newcomers will have the same problem (like me).

What are MarkerNote tags?
The “MakerNote” tags contain image information that is usually in proprietary binary formats, some of which are “manufacturer-specific” and have been “decoded,” but they should not contain information that is accessible to the “outside world.”

Why is this MarkerNote label so easily damaged?
If you move MakerNote tags by inserting or editing previous tags, such as adding copyright information or Exif comments, proprietary formatting may break.

Should I be worried?
Although some manufacturers keep important information, such as Nikon’s ISO speed, in this proprietary format, this information is usually not important.

What am I going to do?
Ignore it, it does not affect the photo quality or related information.

Related Problems and Solutions