We're updating the issue view to help you get more done. 

TurboJPEG write (via TurboJpegImageWorker) throw IllegalArgumentException when a colorExpansion occurs

Description

An user reported an exception occurred in GeoServer when rendering a Gray image with an SLD using a colorMap.

2018-10-05 08:12:19,123 ERROR [geoserver.ows] -
java.lang.IllegalArgumentException: TurboJPEG won't work with this type of sampleModel
at it.geosolutions.imageio.plugins.turbojpeg.TurboJpegImageWriter.write(TurboJpegImageWriter.java:172)
at org.geoserver.map.turbojpeg.TurboJpegImageWorker.writeTurboJPEG(TurboJpegImageWorker.java:127)
at org.geoserver.map.turbojpeg.TurboJPEGMapResponse.formatImageOutputStream(TurboJPEGMapResponse.java:99)

The color expansion to ComponentColorModel introduces an alpha channel but alpha will not be removed by a BandSelect since its presence has been checked too early, right before the color expansion occurred.

Environment

None

Status

Assignee

Daniele Romagnoli

Reporter

Daniele Romagnoli

Triage

None

Fix versions

Affects versions

2.14.0

Priority

Medium