minor image update

This commit is contained in:
Branislav Stojkovic
2019-02-24 14:49:35 +01:00
parent ce43a5d2e6
commit 31ce46f147
4 changed files with 5 additions and 4 deletions
Binary file not shown.
@@ -145,15 +145,16 @@ public class Image extends AbstractTransparentComponent<Void> {
public ImageIcon getImage() {
if (image != null) {
// when loading old files, convert the stored image to byte array and then then discard it, we won't be needing it anymore
BufferedImage bi = ((ToolkitImage) image.getImage()).getBufferedImage();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
ImageIO.write(bi, "png", baos);
// make it official
data = baos.toByteArray();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
data = baos.toByteArray();
}
// don't save back to the file
image = null;
}