By default the Clerezza Platform uses javax.imageio to read image data. However there are at least two scenarios when users may want to change that.

  1. When reading images that ImageIO does not support (different image formats or image formats that may be considered corrupt by ImageIO)
  2. When wanting to improve image processing performance.

A major difficulty in resolving these problems is that normally there is no way other than changing source code and recompiling to make existing services use a different method of reading images. With the introduction of the ImageReaderService all Clerezza Platform components have been changed to use the ImageReaderService when obtaining BufferedImages. This service dynamically looks up services that implement the ImageReader interface in the OSGi SCR (Service Component Runtime) and provides the service that is registered with the highest service.ranking property. By default the Clerezza Platform has only one ImageReader service registered that has a service ranking of 0 and reads images using javax.imageio. The ImageReaderService implement the ImageReader interface as well but delegates all calls to the highest ranking registered ImageReader.

1