location = (String) fileSource;
}
if (location == null) {
RenderedImage image = coverage.getRenderedImage();
if (forceTransparent) {
ImageWorker iw = new ImageWorker(image);
iw.forceComponentColorModel();
final ImageLayout tempLayout = new ImageLayout(image);
tempLayout.unsetValid(ImageLayout.COLOR_MODEL_MASK).unsetValid(
ImageLayout.SAMPLE_MODEL_MASK);
RenderedImage alpha = ConstantDescriptor.create(
Float.valueOf(image.getWidth()), Float.valueOf(image.getHeight()),
new Byte[] { Byte.valueOf((byte) 255) }, new RenderingHints(
JAI.KEY_IMAGE_LAYOUT, tempLayout));
iw.addBand(alpha, false);
image = iw.getRenderedImage();
cm = image.getColorModel();
}
File storedImageFile = storeImage(image, tempFolder);
location = storedImageFile.getAbsolutePath();
removeFiles.add(storedImageFile);