String value = (String) getValue(field.getIndex());
if (value != null && value.length() > 0) {
byte[] bytes = Base64.decode(value.toCharArray());
DcImageIcon current = new DcImageIcon(bytes);
if (current.getIconHeight() > 16 || current.getIconWidth() > 16) {
BufferedImage img = Utilities.toBufferedImage(current, 16, 16);
try {
bytes = Utilities.getBytes(new DcImageIcon(img), DcImageIcon._TYPE_PNG);
setValue(field.getIndex(), new String(Base64.encode(bytes)));
} catch (Exception e) {
logger.error("Could not save scaled image for object with ID " + getID(), e);
}
}