I have used JPG files as ImageMosaic for years without any problems. Recently, however, I received JPG files that, when uploaded to Geoserver as ImageMosaic, return black rectangles. After performing some diagnostics, it turned out that the metadata in the JPG file was to blame. The following entries appear in the Geoserver logs from GeoTools:
DEBUG [imagemosaic.catalog] - Skipping invalid granule
java.lang.IllegalArgumentException: javax.imageio.IIOException: JFIF APP0 must be first marker after SOI
DEBUG [gce.imagemosaic] - Creating constant image for area with no data
After regenerating the metadata itself (using exiftool) in the JPG file, the problem disappears. But … Assuming that for various reasons I do not want to modify the JPG file every time, is it possible for Geoserver to handle such files in its default configuration?
Mapserver handles them As does switching to libJPEG-turbo and disabling the “Use JAI ImageRead” option for the layer. But it would be better if it wasn’t necessary
Tested for the latest Geoserver 2.26.2, GeoTools: 32.2, JRE Eclipse Adoptium 17.0.14, as well as older ones:
Geoserver: 2.23.0, GeoTools: 29.0, Java: 11.0.21+9-post-Ubuntu-0ubuntu122.04
Geoserver: 2.19.0 GeoTools: 25.0 Java: Amazon.com Inc.: 1.8.0_412
JPG file will be attached if possible.