}
public TiffOutputSet getOutputSet() throws ImageWriteException {
final ByteOrder byteOrder = contents.header.byteOrder;
final TiffOutputSet result = new TiffOutputSet(byteOrder);
final List<? extends IImageMetadataItem> srcDirs = getDirectories();
for (IImageMetadataItem srcDir1 : srcDirs) {
final Directory srcDir = (Directory) srcDir1;
if (null != result.findDirectory(srcDir.type)) {
// Certain cameras right directories more than once.
// This is a bug.
// Ignore second directory of a given type.
continue;
}
final TiffOutputDirectory outputDirectory = srcDir
.getOutputDirectory(byteOrder);
result.addDirectory(outputDirectory);
}
return result;
}