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.

Could not initialize class com.twelvemonkeys.imageio.color.ColorSpaces

See original GitHub issue

Ever since upgrading to 3.4, I keep getting sporadic exceptions during the initialization of our software. This is the stacktrace:

Could not initialize class com.twelvemonkeys.imageio.color.ColorSpaces
java.lang.ExceptionInInitializerError
        at com.twelvemonkeys.imageio.color.YCbCrConverter.buildYCCtoRGBtable(YCbCrConverter.java:57)
        at com.twelvemonkeys.imageio.color.YCbCrConverter.<clinit>(YCbCrConverter.java:77)
        at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.convertYCbCr2RGB(JPEGImageReader.java:1276)
        at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.readImageAsRasterAndReplaceColorProfile(JPEGImageReader.java:502)
        at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:388)
        at java.desktop/javax.imageio.ImageIO.read(ImageIO.java:1468)
        ...
Caused by: java.lang.NullPointerException
        at java.desktop/sun.java2d.cmm.lcms.LCMS.getProfileSize(LCMS.java:67)
        at java.desktop/java.awt.color.ICC_Profile.getData(ICC_Profile.java:1332)
        at com.twelvemonkeys.imageio.color.ColorSpaces.<clinit>(ColorSpaces.java:105)
        ... 18 more

This doesn’t happen every time, it’s pretty sporadic. Any ideas? I’m on Linux if that matters. Please tell me if you need any more information.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:23 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
mrserbcommented, Sep 20, 2021

I suggest trying JDK17 where this problem should be fixed and report any new issues you may found.

2reactions
haraldkcommented, Feb 14, 2019

@boris-petrov Different language, I guess. In Java, you would write .getData();.

.k

Read more comments on GitHub >

github_iconTop Results From Across the Web

TwelveMonkeys Plugin with fix not working? - Stack Overflow
I encountered the Unsupported Image Type error due to an incompatible colour profile using com.sun.imageio.plugins ...
Read more >
com.twelvemonkeys.imageio.color.ColorSpaces java code ...
A helper class for working with ICC color profiles and color spaces. Standard ICC color profiles are read from system-specific locations for known...
Read more >
TwelveMonkeys v3.5 release notes (2020-01-24) | LibHunt
The TwelveMonkeys ImageIO version 3.5 is ready for release. ... #437 Fix for Could not initialize class com.twelvemonkeys.imageio.color.ColorSpaces .
Read more >
mattcg / TwelveMonkeys Download - JitPack
This will load the first image of the file, entirely into memory. The basic and simplest form of writing is: if (!ImageIO.write(image, format,...
Read more >
Could not initialize class javax.imageio.Im - Oracle Communities
I tried to open a png file using ImageIO.read(). but i got the following Error: java.lang.NoClassDefFoundError: Could not initialize class ...
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