Skip to content

fix exif bug#15228

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
flyseaworld:exif/read_num_dir
Aug 5, 2019
Merged

fix exif bug#15228
opencv-pushbot merged 1 commit intoopencv:3.4from
flyseaworld:exif/read_num_dir

Conversation

@flyseaworld
Copy link
Copy Markdown

This pullrequest changes

ExifReader::getNumDirEntry use the fixed offset value, which may parse error number of DirEntry in some cases.
Following is structure of TIFF header. We should get the offset through "Offset to first IFD" item.

image

get_thumbnail

@alalek
Copy link
Copy Markdown
Member

alalek commented Aug 5, 2019

Details:

Offset of IFD 4 0th IFD offset. If the TIFF header is followed immediately by the 0th IFD, it is written as 00000008.H.

http://www.digicamsoft.com/exif22/exif22/html/exif22_16.htm

@flyseaworld
Copy link
Copy Markdown
Author

flyseaworld commented Aug 5, 2019

Details:

Offset of IFD 4 0th IFD offset. If the TIFF header is followed immediately by the 0th IFD, it is written as 00000008.H.

http://www.digicamsoft.com/exif22/exif22/html/exif22_16.htm

It is only one common situation. Not all images have TIFF header followed by the 0th IFD, such as the photo given above. Its offset of 0th IFD is 58 instead of fixed value 8. And the photo's orientation is 6, but original version can't get the value.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants