-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception: java.lang.IndexOutOfBoundsException: off < 0 || len < 0 || off+len > b.length || off+len < 0! #665
Comments
The latest version of Cantaloupe is 5.0.6. Could you please provide a test case that reproduces this error using version 5.0.6? |
@anuroopkancherla could you please provide a sample JPEG so we can debug? thanks! |
Note relates to #664 |
@VonUniGE @DiegoPino As per your suggestions I have tried with 5.0.6 version as well, I am still seeing same issue. Output Logs: 2024-07-03 12:24:32 Loading config file: /home/cantaloupe/cantaloupe.properties Below is my Processor Selection in my properties file, I have tried with all the combination of processors for JPG but non has worked out to resolve my issue `#---------------------------------------- Processor Selection#---------------------------------------- processor.selection_strategy = AutomaticSelectionStrategy processor.ManualSelectionStrategy.avi = FfmpegProcessor Fall back to this processor for any formats not assigned above.processor.ManualSelectionStrategy.fallback = Java2dProcessor |
Sorry we cannot share the image on open forum but I can share the metadata of the image ExifTool Version Number : 12.76 |
Did you notice |
I just want to add that I have encountered this problem as well and the root cause seem to be that some programs that compress TIFF source files to JPEG fail to clean up any metadata tags incompatible with JPEG, tags such as This is especially annoying since some of these tags, such as As for what cantaloupe should do in this case, I don't know. |
VERSION= Cantaloupe 5.0.5
processor.selection_strategy = AutomaticSelectionStrategy
URL: /iiif/3/<<image_name>>/info.json
We are using Cantaloupe 5.0.5 server version to process the images. We use AutomaticSelectionStrategy to process the jpg images and while processing some of the jpg images we are observing the java.lang.IndexOutOfBoundsException and the image is not rendering.
500 Internal Server Error
off < 0 || len < 0 || off+len > b.length || off+len < 0! (through reference chain: edu.illinois.library.cantaloupe.processor.codec.jpeg.JPEGMetadata["exif"])
com.fasterxml.jackson.databind.JsonMappingException: off < 0 || len < 0 || off+len > b.length || off+len < 0! (through reference chain: edu.illinois.library.cantaloupe.processor.codec.jpeg.JPEGMetadata["exif"])
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:397)
at com.fasterxml.jackson.databind.JsonMappingException.wrapWithPath(JsonMappingException.java:356)
at com.fasterxml.jackson.databind.ser.std.StdSerializer.wrapAndThrow(StdSerializer.java:316)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:731)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:166)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:3024)
at com.fasterxml.jackson.core.base.GeneratorBase.writeObject(GeneratorBase.java:388)
at com.fasterxml.jackson.core.JsonGenerator.writeObjectField(JsonGenerator.java:1838)
at edu.illinois.library.cantaloupe.image.InfoSerializer.serialize(InfoSerializer.java:56)
at edu.illinois.library.cantaloupe.image.InfoSerializer.serialize(InfoSerializer.java:16)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1513)
at com.fasterxml.jackson.databind.ObjectWriter._configAndWriteValue(ObjectWriter.java:1215)
at com.fasterxml.jackson.databind.ObjectWriter.writeValueAsString(ObjectWriter.java:1085)
at edu.illinois.library.cantaloupe.image.Info.toJSON(Info.java:513)
at edu.illinois.library.cantaloupe.processor.AbstractImageIOProcessor.readInfo(AbstractImageIOProcessor.java:104)
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.v3.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)
Caused by: java.lang.IndexOutOfBoundsException: off < 0 || len < 0 || off+len > b.length || off+len < 0!
at java.desktop/javax.imageio.stream.MemoryCacheImageInputStream.read(MemoryCacheImageInputStream.java:100)
at edu.illinois.library.cantaloupe.image.exif.Reader.readBytes(Reader.java:159)
at edu.illinois.library.cantaloupe.image.exif.Reader.read(Reader.java:145)
at edu.illinois.library.cantaloupe.image.exif.Reader.read(Reader.java:97)
at edu.illinois.library.cantaloupe.processor.codec.jpeg.JPEGMetadata.getEXIF(JPEGMetadata.java:51)
at jdk.internal.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:689)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:723)
... 51 more
Please help us to understand the problem and potential workaround to solve this exception and also want to understand if this issue is related to cantaloupe server.
Thank you !!!!
The text was updated successfully, but these errors were encountered: