question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Out of memory while reading Exif data from JPEG file

See original GitHub issue

While trying to read exif data from the attached image we got an “out of memory” exception. Looks like the image is somehow corrupted but maybe the exception thrown can be prevented as it tears down the our whole application. Please take a look. Thanks in advance!

Uncaught error from thread [application-thumbnailing-context-26] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[application]
java.lang.OutOfMemoryError: Java heap space
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readValue(TIFFReader.java:407)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readValueAt(TIFFReader.java:324)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readEntry(TIFFReader.java:298)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readIFD(TIFFReader.java:146)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readSubIFDs(TIFFReader.java:188)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readIFD(TIFFReader.java:158)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readSubIFDs(TIFFReader.java:188)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readIFD(TIFFReader.java:158)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readSubIFDs(TIFFReader.java:188)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readIFD(TIFFReader.java:158)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readSubIFDs(TIFFReader.java:188)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readIFD(TIFFReader.java:158)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.readLinkedIFDs(TIFFReader.java:120)
    at com.twelvemonkeys.imageio.metadata.tiff.TIFFReader.read(TIFFReader.java:109)
    at com.twelvemonkeys.imageio.metadata.exif.EXIFReader.read(EXIFReader.java:55)

20190117_die macht der gefuhle_ute frevert

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
haraldkcommented, Feb 12, 2019

Sorry for taking too long. My initial fix works reliably only for the first image.

The problem with the second one is different, here the TIFF contains bad offsets, but I have a fix for this issue soon as well.

– Harald K

2reactions
haraldkcommented, Jan 30, 2019

The fix I made for the first image works for this one as well. I just need to clean the code and create a test case before committing.

– Harald K

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why? Trying to write jpeg in memory and save to file does ...
I'm trying to do the following: 1. Create a memory buffer with valid jpg image. 2. Add Exif data to the jpg image...
Read more >
Understanding and Reading Exif Data - CodeProject
This article explains how to retrieve valuable image information from the Exif data found in JPEG images, and provides a Silverlight class ...
Read more >
How to remove image metadata from large images without out ...
Problem is that ImageIO.read(...) will read the whole file into memory, which causes OutOfMemory when I'm processing images that are too big. I ......
Read more >
How to Obtain Valuable Data from Images Using Exif Extractors
Removing the metadata is useful if you want to make sure an image you're sending doesn't contain data you didn't intend to send....
Read more >
How to Read and Remove Metadata from Your Photos ... - Auth0
How can I programmatically detect and read the EXIF metadata from a photo? ... It reads the file's data in binary format into...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found