use of com.drew.metadata.xmp.XmpDirectory in project drill by apache.
the class ImageBatchReader method processExtenalMetadata.
private void processExtenalMetadata() {
boolean skipEPSPreview = false;
for (Directory directory : metadata.getDirectories()) {
// Skip the `Generic Metadata Directory`
String dictName = ImageMetadataUtils.formatName(directory.getName());
if (directory instanceof GenericMetadataDirectory) {
continue;
}
if (directory instanceof ExifIFD0Directory && skipEPSPreview) {
skipEPSPreview = false;
continue;
}
if (directory instanceof EpsDirectory) {
// If an EPS file contains a TIFF preview, skip the next IFD0
skipEPSPreview = directory.containsTag(EpsDirectory.TAG_TIFF_PREVIEW_SIZE);
}
// Process the `External Metadata Directory`
MapColumnDefn columnDefn = new MapColumnDefn(dictName).builder(loader);
ImageDirectoryProcessor.processDirectory(columnDefn, directory, metadata, config);
// Continue to process XmpDirectory if exists
if (directory instanceof XmpDirectory) {
ImageDirectoryProcessor.processXmpDirectory(columnDefn, (XmpDirectory) directory);
}
}
}
Aggregations