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

Tag 'Image Height' has not been set for HEIC #610

Closed ArchanaAnand0212 closed 1 year ago

ArchanaAnand0212 commented 1 year ago

I am trying to get HEIGHT and WIDTH information for HEIC image format.

I can see that the correct information is present in ExifSubIFDDirectory but when I try to get the height and width using, exifSubIFDDirectory.getInt(ExifSubIFDDirectory.TAG_IMAGE_HEIGHT); error is thrown saying error msg: Tag 'Image Height' has not been set

If I iterate over the tag name, I can find "Exif Image Width" .

I think the problem is ExifSubIFDDirectory.TAG_IMAGE_HEIGHT key is 257 Whereas in map the key for Image Height is 40963

This might need change in ExifSubIFDDirectory. Please let me know when can this be fixed. Please feel free to use this image for test purpose IMG_0072.HEIC.zip

ArchanaAnand0212 commented 1 year ago

ExifSubIFDDirectory.TAG_EXIF_IMAGE_WIDTH and ExifSubIFDDirectory.TAG_EXIF_IMAGE_HEIGHT is correct tag to look at. I guess because HEIC is compressed image.