drewnoakes / metadata-extractor

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Apache License 2.0
2.54k stars 475 forks source link

Exif TAG_THUMBNAIL_OFFSET reports wrong value #578

Closed StefanOltmann closed 1 year ago

StefanOltmann commented 2 years ago

I try to extract a thumbnail from a JPG, but exifThumbnail.getInt(ExifThumbnailDirectory.TAG_THUMBNAIL_OFFSET) reports the wrong offset compared to exiftool, which has the correct value.

I tried this on multiple Unsplash photos like this one: FFsiikfJEAI

I'm certain the logic determining the thumbnail offset is broken. The thumbnail length is correct.

StefanOltmann commented 1 year ago

For anyone still looking: The library https://github.com/dragon66/pixymeta can report the correct thumbnail offsets and also extract the bytes.