public TurboJPEGMapResponse(WMS wms) { super(MIME_TYPE, wms); fallback = new JPEGMapResponse(wms); if(!TURBO_JPEG_LIB_AVAILABLE){ if(LOGGER.isLoggable(Level.WARNING)){ LOGGER.warning("The turbo jpeg encoder is not available, check the native libs installation"); } } else { if(LOGGER.isLoggable(Level.WARNING)){ LOGGER.warning("The turbo jpeg encoder is available for usage"); } } if(DISABLE_TURBO){ if(LOGGER.isLoggable(Level.WARNING)){ LOGGER.warning("The turbo jpeg encoder has been explicitly disabled"); } } }
LOGGER.info("About to fallback on standard lib as libjpeg-turbi is not available"); fallback.formatImageOutputStream(image, outStream, mapContent); return;
/** * Transforms the rendered image into the appropriate format, streaming to the output stream. * * @see RasterMapOutputFormat#formatImageOutputStream(RenderedImage, OutputStream) */ @Override public void formatImageOutputStream( RenderedImage image, OutputStream outStream, WMSMapContent mapContent) throws ServiceException, IOException { JpegOrPngChooser chooser = JpegOrPngChooser.getFromMapContent(image, mapContent); if (chooser.isJpegPreferred()) { jpegResponse.formatImageOutputStream(image, outStream, mapContent); } else { pngResponse.formatImageOutputStream(image, outStream, mapContent); } }