static BufferedImage cloneBufferedImageWithMetaSrc(O src, BufferedImage img) { if (img == null) null; new Hashtable properties; fOr (key : img.getPropertyNames()) properties.put(key, img.getProperty(key)); if (!properties.containsKey("IMeta")) properties.put("IMeta", new Meta); var cm = img.getColorModel(); ret new BufferedImage(cm, img.getRaster(), cm.hasAlpha() && cm.isAlphaPremultiplied(), properties); }