cantaloupe-project / cantaloupe

High-performance dynamic image server in Java
https://cantaloupe-project.github.io/
Other
270 stars 111 forks source link

Getting EOFException with TurboJpegProcessor #590

Open erikradisch opened 2 years ago

erikradisch commented 2 years ago

Using TurboJpegProcessor, I do get the following error retrieving a jpeg:

500 Internal Server Error

java.io.EOFException
    at java.desktop/javax.imageio.stream.ImageInputStreamImpl.readShort(ImageInputStreamImpl.java:229)
    at java.desktop/javax.imageio.stream.ImageInputStreamImpl.readUnsignedShort(ImageInputStreamImpl.java:242)
    at edu.illinois.library.cantaloupe.image.exif.Reader.read(Reader.java:113)
    at edu.illinois.library.cantaloupe.image.exif.Reader.read(Reader.java:129)
    at edu.illinois.library.cantaloupe.image.exif.Reader.read(Reader.java:97)
    at edu.illinois.library.cantaloupe.processor.TurboJpegProcessor.readMetadata(TurboJpegProcessor.java:275)
    at edu.illinois.library.cantaloupe.processor.TurboJpegProcessor.readInfo(TurboJpegProcessor.java:263)
    at edu.illinois.library.cantaloupe.cache.InfoService.readInfo(InfoService.java:220)
    at edu.illinois.library.cantaloupe.cache.InfoService.getOrReadInfo(InfoService.java:153)
    at edu.illinois.library.cantaloupe.cache.CacheFacade.getOrReadInfo(CacheFacade.java:67)
    at edu.illinois.library.cantaloupe.resource.AbstractRequestHandler.getOrReadInfo(AbstractRequestHandler.java:39)
    at edu.illinois.library.cantaloupe.resource.InformationRequestHandler.handle(InformationRequestHandler.java:287)
    at edu.illinois.library.cantaloupe.resource.iiif.v2.InformationResource.doGET(InformationResource.java:85)
    at edu.illinois.library.cantaloupe.resource.HandlerServlet.handle(HandlerServlet.java:97)
    at edu.illinois.library.cantaloupe.resource.HandlerServlet.doGet(HandlerServlet.java:35)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:791)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:550)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1434)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:501)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1349)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
    at org.eclipse.jetty.server.Server.handle(Server.java:516)
    at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:383)
    at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:556)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:375)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:273)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
    at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:336)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:313)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:171)
    at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:129)
    at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:375)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:773)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:905)
    at java.base/java.lang.Thread.run(Thread.java:829)

For reproduction, you can call: https://iiif.saw-leipzig.de/iiif/2/kucha%2Fimages%2F3517.jpg/0,0,2048,2048/2048,/0/default.jpg

Is this a known issue? Or do I do something wrong?

adolski commented 2 years ago

This looks like a bug. Could you post the source image somewhere where I can access it?

erikradisch commented 2 years ago

Sure, you find it here: https://cloud.saw-leipzig.de/s/q85pxSFzfFfBkrn

adolski commented 2 years ago

Thanks @erikradisch , I'm busy with other things right now but I will look into this when I can.

erikradisch commented 2 years ago

hey @adolski any updates on that? do you have an Idea, what is causing the trouble? Maybe I could try and help?