drewnoakes/metadata-extractor

Deep recursion / stackoverflow with tiff image

Open

#559 aperta il 1 dic 2021

Vedi su GitHub
 (5 commenti) (1 reazione) (0 assegnatari)Java (470 fork)batch import
format-tiffhelp wantedimage-queue

Metriche repository

Star
 (2411 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

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.

Guida contributor