While fixing GEOS-7270 I found that rendering an coverage with an indexed color model via GridCoverageRenderer.renderImage(reader,...) produced a null pointer exception:
java.lang.NullPointerException: Argument "bgColor" should not be null.
at org.geotools.resources.image.ColorUtilities.findColorIndex(ColorUtilities.java:506)
at org.geotools.renderer.lite.gridcoverage2d.GridCoverageRenderer.renderImage(GridCoverageRenderer.java:822)
The problem comes from attempting to expand the color model on an indexed raster even when a background color hasn't been provided. |