-
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.IllegalArgumentException: Invalid ICC Profile Data #664
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 Java2D (the processor that was automatically selected) does an internal ICC validation (see https://code.googlesource.com/edge/openjdk/+/refs/heads/master/jdk/src/share/classes/sun/java2d/cmm/ProfileDataVerifier.java) and when that fails it throws an exception. As @VonUniGE correctly stated, without seeing an example of an affected image it is hard determine if Java2D is not being able to recognize a valid color profile or the color profile is indeed wrong (and we have seen those in the wild many times). There might be a valid point of discussion/to be made if an exception at that level should end in a 500 code (and break the whole processing chain) or should instead generate log warnings (which maybe people won't read...) and still attempt to process even if EXIF processing failed. Could you also try processing JPEGs with one of the other processors to compare? (can be easily changed in the settings) |
@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:38:55 16:38:55.470 [qtp2089016471-15] INFO e.i.l.c.r.i.v.InformationResource - Handling GET /iiif/3/603002_Box15_Folder05-001.jpg/info.json 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. I cannot share the sample image but below is the metadata of the image which is causing the issue. ExifTool Version Number : 12.76 |
Did you see?
|
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 Invalid ICC Profile Data exception and the image is not rendering.
500 Internal Server Error
Invalid ICC Profile Data (through reference chain: edu.illinois.library.cantaloupe.processor.codec.jpeg.JPEGMetadata["exif"])
com.fasterxml.jackson.databind.JsonMappingException: Invalid ICC Profile Data (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.IllegalArgumentException: Invalid ICC Profile Data
at java.desktop/sun.java2d.cmm.ProfileDataVerifier.verify(ProfileDataVerifier.java:56)
at java.desktop/java.awt.color.ICC_Profile.getInstance(ICC_Profile.java:773)
at java.desktop/com.sun.imageio.plugins.jpeg.JFIFMarkerSegment$ICCMarkerSegment.getNativeNode(JFIFMarkerSegment.java:1545)
at java.desktop/com.sun.imageio.plugins.jpeg.JFIFMarkerSegment.getNativeNode(JFIFMarkerSegment.java:240)
at java.desktop/com.sun.imageio.plugins.jpeg.JPEGMetadata.getNativeTree(JPEGMetadata.java:785)
at java.desktop/com.sun.imageio.plugins.jpeg.JPEGMetadata.getAsTree(JPEGMetadata.java:757)
at edu.illinois.library.cantaloupe.processor.codec.IIOMetadata.getAsTree(IIOMetadata.java:24)
at edu.illinois.library.cantaloupe.processor.codec.jpeg.JPEGMetadata.getEXIF(JPEGMetadata.java:39)
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: