protected IIOMetadata updateMetadata(IIOMetadata meta, ImageWriterParams params) {
//ImageIODebugUtil.dumpMetadata(meta);
if (JPEG_NATIVE_FORMAT.equals(meta.getNativeMetadataFormatName())) {
meta = addAdobeTransform(meta);
IIOMetadataNode root = (IIOMetadataNode)meta.getAsTree(JPEG_NATIVE_FORMAT);
//IIOMetadataNode root = new IIOMetadataNode(jpegmeta);
IIOMetadataNode jv = getChildNode(root, "JPEGvariety");
if (jv == null) {
jv = new IIOMetadataNode("JPEGvariety");
root.appendChild(jv);
}
IIOMetadataNode child;
if (params.getResolution() != null) {
child = getChildNode(jv, "app0JFIF");
if (child == null) {
child = new IIOMetadataNode("app0JFIF");
jv.appendChild(child);
}
//JPEG gets special treatment because there seems to be a bug in
//the JPEG codec in ImageIO converting the pixel size incorrectly
//(or not at all) when using standard metadata format.
child.setAttribute("majorVersion", null);
child.setAttribute("minorVersion", null);
child.setAttribute("resUnits", "1"); //dots per inch
child.setAttribute("Xdensity", params.getResolution().toString());
child.setAttribute("Ydensity", params.getResolution().toString());
child.setAttribute("thumbWidth", null);
child.setAttribute("thumbHeight", null);
}
/*
IIOMetadataNode ms = getChildNode(root, "markerSequence");