}
if (chooser.showSaveDialog(imageRootPanel) == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
prefs.setLastOutputImageFile(file);
RenderedFlame res = renderer.finishRenderFlame(displayUpdater.getSampleCount());
new ImageWriter().saveImage(res.getImage(), file.getAbsolutePath());
if (res.getHDRImage() != null) {
new ImageWriter().saveImage(res.getHDRImage(), file.getAbsolutePath() + ".hdr");
}
if (res.getHDRIntensityMap() != null) {
new ImageWriter().saveImage(res.getHDRIntensityMap(), file.getAbsolutePath() + ".intensity.hdr");
}
if (prefs.isTinaSaveFlamesWhenImageIsSaved()) {
new FlameWriter().writeFlame(getCurrFlame(), file.getParentFile().getAbsolutePath() + File.separator + Tools.trimFileExt(file.getName()) + ".flame");
}
}