drewnoakes / metadata-extractor

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

Fix ClassCastException when parsing Apple metadata of unexpected type #589

Closed mveunen closed 2 years ago

mveunen commented 2 years ago

Sometimes the Apple metadata is stored as a String. This fix will prevent a ClassCastException

We have found a few images where the JPG contained metadata as String instead of Bytes/Longs:. These images were created using an iPhone 7 or 8 with an unknown iOS version.

Examples of the metadata as String: bplist00ÔUflagsUvalueUepochYtimescaleQ1]3448599201458Q0Z1000000000#-/=? and bplist00ÔUflagsUvalueUepochYtimescaleQ1]3408834508875Q0Z1000000000#-/=?

drewnoakes commented 2 years ago

Thank you for your contribution. Please undo the formatting changes so that we can more easily see what you have actually changed here.

drewnoakes commented 2 years ago

Also if you're able to share an image that reproduces this problem, it would be helpful.

mveunen commented 2 years ago

Thank you for your contribution. Please undo the formatting changes so that we can more easily see what you have actually changed here.

Sorry, that was automatically done by my IDE. It should be better after the last commit

mveunen commented 2 years ago

Also if you're able to share an image that reproduces this problem, it would be helpful.

Unfortunately I cannot share the images we have due to legal issues.