drewnoakes / metadata-extractor

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

Failed reading EXIF of a WebP image #473

Closed PearlPig123 closed 4 years ago

PearlPig123 commented 4 years ago

Hi, I got a TiffProcessingException when running: Metadata webpMetadata = WebpMetadataReader.readMetadata(imgStream);

The stacktrace is as below: com.drew.imaging.tiff.TiffProcessingException: Unclear distinction between Motorola/Intel byte ordering: 17784 at com.drew.imaging.tiff.TiffReader.processTiff(TiffReader.java:60) at com.drew.metadata.exif.ExifReader.extract(ExifReader.java:87) at com.drew.metadata.exif.ExifReader.extract(ExifReader.java:77) at com.drew.metadata.exif.ExifReader.extract(ExifReader.java:71) at com.drew.metadata.webp.WebpRiffHandler.processChunk(WebpRiffHandler.java:76) at com.drew.imaging.riff.RiffReader.processRiff(RiffReader.java:87) at com.drew.imaging.webp.WebpMetadataReader.readMetadata(WebpMetadataReader.java:58)

The WebP image I used is: https://drive.google.com/file/d/1HW9N0lS0VQWqC7_WD6fCxPJ102fYqnTv/view?usp=sharing It is a JPEG originally and I converted it to WebP using ImageMagick commandline for testing purpose.

drewnoakes commented 4 years ago

Thanks for the report. Firstly, would you be willing and able to grant permission to add this image to https://github.com/drewnoakes/metadata-extractor-images for regression testing purposes?

PearlPig123 commented 4 years ago

Thanks for the report. Firstly, would you be willing and able to grant permission to add this image to https://github.com/drewnoakes/metadata-extractor-images for regression testing purposes?

Yes, feel free to add it.

drewnoakes commented 4 years ago

@JieyingXu thank you, I'll add the image.

Pushed a fix to master. Thanks for the bug report.

PearlPig123 commented 4 years ago

@JieyingXu thank you, I'll add the image.

Pushed a fix to master. Thanks for the bug report.

@drewnoakes May I ask how can I depend on this fix if it is not released yet? I am using maven to inject metadata-extractor into my code.