*
* @param bImage BufferedImage containing raster data
* @return File object for temporary image file
*/
public static File createTempTiff(BufferedImage bImage) throws Exception {
TIFWriter tifWriter = new TIFWriter();
File tifFile = File.createTempFile("tmp", ".tif");
FileOutputStream fileOut = new FileOutputStream(tifFile);
BufferedOutputStream outStream = new BufferedOutputStream(fileOut);
tifWriter.write(bImage, outStream);
outStream.close();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Temp tiff file created: {} (size: {})", tifFile, tifFile.length());
}