You seem to be missing the META-INF/services/
resources needed for the service registry to pick up your Spi classes.
The resources are text files, and need to be named after the Spi class they implement (one for writer and one for reader), and contain one single line with the exact name of your Spi implementation class.
You need the following files (in java_imageio/wrapping/java/openjp2/src/main/resources):
/META-INF/services/javax.imageio.spi.ImageReaderSpi
# File content (comments allowed)
org.openJpeg.JP2KOpenJpegImageReaderSpi
/META-INF/services/javax.imageio.spi.ImageWriterSpi
# File content (comments allowed)
org.openJpeg.JP2KOpenJpegImageWriterSpi
Some additional comments: While not directly related to registration, I browsed your source code, and there might be some other issues with your Spi class.
- For
inputTypes
you listFile
,byte[]
andURL
. While these types might be okay,ImageIO
will likely require you to supportImageInputStream
as well (most readers only support this), for normal operation. See the staticread
methods onImageIO
, and how they are implemented. - The
canDecodeInput
is supposed to look into the file/stream contents to recognize format "magic" identifiers or header structure. If you simply returntrue
, your reader will try to decode anyFile
,byte[]
andURL
regardless of content, not giving other readers a chance to properly read them. And again, I think you have to supportImageInputStream
as input for normal operation. - (I assume the hardcoded JNI paths are only temporay.. :-)