保存源码位置
Metadata metadata = ImageMetadataReader.readMetadata (bin );
错误信息
com.drew.lang.BufferBoundsException: Attempt to read from beyond end of underlying data source (requested index: 6, requested count: 2, max index: 5 )
at com.drew.lang.ByteArrayReader.validateIndex (ByteArrayReader.java:68 )
at com.drew.lang.RandomAccessReader.getInt16 (RandomAccessReader.java:205 )
at com.drew.imaging.tiff.TiffReader.processTiff (TiffReader.java:53 )
at com.drew.metadata.exif.ExifReader.extract (ExifReader.java:88 )
at com.drew.metadata.exif.ExifReader.readJpegSegments (ExifReader.java:73 )
at com.drew.imaging.jpeg.JpegMetadataReader.processJpegSegmentData (JpegMetadataReader.java:126 )
at com.drew.imaging.jpeg.JpegMetadataReader.process (JpegMetadataReader.java:118 )
at com.drew.imaging.jpeg.JpegMetadataReader.readMetadata (JpegMetadataReader.java:69 )
at com.drew.imaging.jpeg.JpegMetadataReader.readMetadata (JpegMetadataReader.java:76 )
at com.drew.imaging.ImageMetadataReader.readMetadata (ImageMetadataReader.java:98 )
用catch (Exception e )
尝试过无法捕获
<dependency>
<groupId>com.drewnoakes</groupId>
<artifactId>metadata-extractor</artifactId>
<version>2.8.1</version>
</dependency>