Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Exif TAG_THUMBNAIL_OFFSET reports wrong value #578

Closed
StefanOltmann opened this issue Jun 2, 2022 · 1 comment · Fixed by #612
Closed

Exif TAG_THUMBNAIL_OFFSET reports wrong value #578

StefanOltmann opened this issue Jun 2, 2022 · 1 comment · Fixed by #612
Labels

Comments

@StefanOltmann
Copy link
Contributor

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 StefanOltmann changed the title TAG_THUMBNAIL_OFFSET reports wrong number TAG_THUMBNAIL_OFFSET reports wrong value Jun 2, 2022
@drewnoakes drewnoakes added help wanted format-jpeg image-queue Actionable issue with sample image labels Jun 5, 2022
@drewnoakes drewnoakes changed the title TAG_THUMBNAIL_OFFSET reports wrong value Exif TAG_THUMBNAIL_OFFSET reports wrong value Jun 5, 2022
@StefanOltmann
Copy link
Contributor Author

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

drewnoakes added a commit that referenced this issue May 8, 2023
Fixes #578

The offset is currently reported relative to the start of the Exif data. However, most users will need the value relative to the start of the outermost data stream. This change attempts to provide that value.

Should work for JPEG and RAW files. Won't work for Exif data embedded within other formats such as PNG, QuickTime, WebP or HEIF. Such support could be added in future.
drewnoakes added a commit that referenced this issue May 8, 2023
Fixes #578

The offset is currently reported relative to the start of the Exif data. However, most users will need the value relative to the start of the outermost data stream. This change attempts to provide that value.

Should work for JPEG and RAW files. Won't work for Exif data embedded within other formats such as PNG, QuickTime, WebP or HEIF. Such support could be added in future.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants