.getMetadata(imageFile);
if (null == oldMetadata)
continue;
assertNotNull(oldMetadata);
TiffImageMetadata oldExifMetadata = oldMetadata.getExif();
if (null == oldExifMetadata)
continue;
assertNotNull(oldExifMetadata);
oldMetadata.dump();
// TiffImageMetadata tiffImageMetadata = metadata.getExif();
// Photoshop photoshop = metadata.getPhotoshop();
TiffOutputSet outputSet = oldExifMetadata.getOutputSet();
// outputSet.dump();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
rewriter.rewrite(byteSource, baos, outputSet);
byte bytes[] = baos.toByteArray();
File tempFile = createTempFile(name + "_", ".jpg");
Debug.debug("tempFile", tempFile);
IOUtils.writeToFile(bytes, tempFile);
Debug.debug("Output Segments:");
new JpegUtils().dumpJFIF(new ByteSourceArray(bytes));
// assertTrue(!hasExifData(tempFile));
JpegImageMetadata newMetadata = (JpegImageMetadata) Sanselan
.getMetadata(tempFile);
assertNotNull(newMetadata);
TiffImageMetadata newExifMetadata = newMetadata.getExif();
assertNotNull(newExifMetadata);
// newMetadata.dump();
compare(imageFile, oldExifMetadata, newExifMetadata);
}