Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Reading 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 taken on an Olympus TG-4 and tried to read the Exif data with Python 3.

My script says:

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

I get the message 'Possibly corrupted field Tag 0x0000 in MakerNote IFD' I've tried five different jpg files, they all result in the same message. I took the pictures today - are they all really corrupt?

This is 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 assume the camera stores the metadata in some proprietary format Exifread doesn't expect? I just want to read the metadata and store it in a text file, then import into a database. I guess reading it out of the dictionary is an workable solution. Would be interested if anyone could shed any light on why Exifread isn't working.

like image 771
user1707389 Avatar asked Dec 18 '25 14:12

user1707389


1 Answers

I was doing some small research because of a similar issue. I know the question is old, but maybe some new person will have the same issue(like me).

What is MarkerNote Tag? The "MakerNote" tag contains image information normally in a proprietary binary format, some of this "manufacturer-specific" were "decoded", but they shouldn't contain information that should be accessible to "outside world".

Why this MarkerNote Tags get so easily corrupted? The proprietary formats could break if the MakerNote tag is moved by inserting or editing a tag that precedes it(e.g add a copyright info or an Exif comment).

Should I worry? Although some of the manufacturers keep important information in this proprietary format(e.g Nikon for ISO Speed), the information is, usually, not important.

What should I do? Just ignore it, it doesn't affect the photo quality or relevant information.

like image 67
Heto Avatar answered Dec 20 '25 11:12

Heto



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!