drewnoakes/metadata-extractor

Deep recursion / stackoverflow with tiff image

Open

#559 建立於 2021年12月1日

在 GitHub 查看
 (5 留言) (1 反應) (0 負責人)Java (2,411 star) (470 fork)batch import
format-tiffhelp wantedimage-queue

描述

Hello.

Tiff image can be downloaded here: https://github.com/cgohlke/imagecodecs/blob/master/tests/tiff/gray.movie.u2.tif

Then try to extract metadata by using this code:

InputStream inputStream = new ByteArrayInputStream(imageBlob);

Metadata metadata = ImageMetadataReader.readMetadata(inputStream);

Directory mimeTypeDir = metadata.getFirstDirectoryOfType(FileTypeDirectory.class);

String mimeType = mimeTypeDir.getString(3);
String extension = mimeTypeDir.getString(4);

This should throw a java.lang.StackOverflowError

I also tried using a a tool like ExifTool and it threw a similar warning: Deep recursion on subroutine "Image::ExifTool::ProcessDirectory" Deep recursion on subroutine "Image::ExifTool::Exif::ProcessExif"

Let me know if you need more details.

貢獻者指南