public void saveAsImage(Image img, File target, String format)
throws IOException {
try {
- BufferedImage image = ImageUtilsAwt.fromImage(img);
+ BufferedImage image = fromImage(img);
boolean ok = false;
try {
}
// Some formats are not reliable
- // Second change: PNG
+ // Second chance: PNG
if (!ok && !format.equals("png")) {
ok = ImageIO.write(image, "png", target);
}
* @throws IOException
* in case of IO error
*/
- static public BufferedImage fromImage(Image img) throws IOException {
+ public static BufferedImage fromImage(Image img) throws IOException {
InputStream in = new ByteArrayInputStream(img.getData());
int orientation;