drewnoakes / metadata-extractor

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

HEIC.width and HEIC.height wrong #560

Closed davidekholm closed 2 years ago

davidekholm commented 2 years ago

When inspecting the HEIC directory for HEIC images, the "width" and "height" tags are 512 and 512 pixels respectively. Shouldn't they reflect the image width and height?

I put some debug data inside ImageSpatialExtentsProperty.java and noticed that it's instantiated 3 times when reading metadata for an image. The 2:nd time with the correct values. However, they never make it to the final image.

Sample image: https://jalbum.net/download/IMG_9721.HEIC

drewnoakes commented 2 years ago

Hi David.

Are you able to provide that image to the test data library here so we can use it for regression testing? We don't have much coverage of HEIF/HEIC files.

I don't have time to dig into the details here at the moment. @payton added the HEIF support and has more context on this issue.

payton commented 2 years ago

Hi @davidekholm - This is a known bug. At the moment, we simply return the first image found (which may be a thumbnail or other auxiliary image) while we should be finding the primary image (as you pointed out).

Duplicate of #373

445 was one PR put up in an attempt to resolve this issue. However, it still needs to be investigated (as per the PR comments).