Read raw EXIF bytes?

Added by Jim Nelson about 2 years ago

Hello,

I need to take the raw EXIF bytes in a file and generate an MD5 hash of them. I need the EXIF in the file itself, not the EXIF that Exiv2 would generate on an encode. Is there any way to do this?

Thanks,

-- Jim


Replies

RE: Read raw EXIF bytes? - Added by Andreas Huggel about 2 years ago

Hi Jim,

There is currently no interface to access the binary Exif data, that's actually an old outstanding feature (#467).
I believe implementing this feature for JPEG images would actually be quite straightforward. If you want to help out with this, here is a quick sketch how I'd do this:

  • add new accessor members const byte* rawExif() const and long rawExifSize() const to class JpegBase
  • add corresponding new data members const byte* rawExif_ and long rawExifSize_
  • populate the new members in JpegBase::readMetadata from the local DataBuf rawExif (using DataBuf::release(), without copying the data)
  • Free the memory in the destructor

Looking forward to your patch :)

Andreas