private Map<String, String> getTags(Integer max, Metadata metadata) { Map<String, String> results = new HashMap<>(); int i =0; for (Directory directory : metadata.getDirectories()) { for (Tag tag : directory.getTags()) { results.put(directory.getName() + "." + tag.getTagName(), tag.getDescription()); if(max!=null) { i++; if (i >= max) { return results; } } } } return results; } }
String tagName = tag.getTagName(); String directoryName = directory.getName(); String description = tag.getDescription();
for (Tag tag : directory.getTags()) { String tagName = tag.getTagName(); String description = tag.getDescription();
/** * A basic representation of the tag's type and value. EG: <code>[Exif IFD0] FNumber - f/2.8</code>. * * @return the tag's type and value */ @Override @NotNull public String toString() { String description = getDescription(); if (description == null) description = _directory.getString(getTagType()) + " (unable to formulate description)"; return "[" + _directory.getName() + "] " + getTagName() + " - " + description; } }
for (Tag tag : directory.getTags()) { if (tag.getTagType() == ExifDirectoryBase.TAG_DATETIME) { dateTime = tag.getDescription();
String description; try { description = tag.getDescription(); } catch (Exception ex) { description = "ERROR: " + ex.getMessage();
@Override public void onExtractionSuccess(@NotNull File file, @NotNull Metadata metadata, @NotNull String relativePath, @NotNull PrintStream log) { super.onExtractionSuccess(file, metadata, relativePath, log); // Iterate through all values, calling toString to flush out any formatting exceptions for (Directory directory : metadata.getDirectories()) { directory.getName(); for (Tag tag : directory.getTags()) { tag.getTagName(); tag.getDescription(); } } } }
public void handle(Directory directory, Metadata metadata) throws MetadataException { if (directory.getTags() != null) { for (Tag tag : directory.getTags()) { String name = tag.getTagName(); if (!MetadataFields.isMetadataField(name) && tag.getDescription() != null) { String value = tag.getDescription().trim(); if (Boolean.TRUE.toString().equalsIgnoreCase(value)) { value = Boolean.TRUE.toString(); } else if (Boolean.FALSE.toString().equalsIgnoreCase(value)) { value = Boolean.FALSE.toString(); } metadata.set(name, value); } } } } }
public void handle(Directory directory, Metadata metadata) throws MetadataException { if (directory.getTags() != null) { for (Tag tag : directory.getTags()) { metadata.set(tag.getTagName(), tag.getDescription()); } } } }
@Override public HashMap<String, String> getTags() { HashMap<String, String> tagMap = new HashMap<String, String>(); if (directory != null) { for (Tag tag : directory.getTags()) { tagMap.put(tag.getTagName(), tag.getDescription()); } } return tagMap; }
@Override public HashMap<String, String> getTags() { HashMap<String, String> tagMap = new HashMap<String, String>(); if (directory != null) { for (Tag tag : directory.getTags()) { tagMap.put(tag.getTagName(), tag.getDescription()); } } return tagMap; }
public void handle(Directory directory, Metadata metadata) throws MetadataException { if (directory.getTags() != null) { for (Tag tag : directory.getTags()) { String name = tag.getTagName(); if (!MetadataFields.isMetadataField(name) && tag.getDescription() != null) { String value = tag.getDescription().trim(); if (Boolean.TRUE.toString().equalsIgnoreCase(value)) { value = Boolean.TRUE.toString(); } else if (Boolean.FALSE.toString().equalsIgnoreCase(value)) { value = Boolean.FALSE.toString(); } metadata.set(name, value); } } } } }
public void handle(Directory directory, Metadata metadata) throws MetadataException { if (directory.getTags() != null) { for (Tag tag : directory.getTags()) { String name = tag.getTagName(); if (!MetadataFields.isMetadataField(name) && tag.getDescription() != null) { String value = tag.getDescription().trim(); if (Boolean.TRUE.toString().equalsIgnoreCase(value)) { value = Boolean.TRUE.toString(); } else if (Boolean.FALSE.toString().equalsIgnoreCase(value)) { value = Boolean.FALSE.toString(); } metadata.set(name, value); } } } } }
DirNode(Directory dir) { this.dir = dir; Collection<Tag> tags = dir.getTags(); int tagIndex = 0; for (Tag tag : tags) { String tagName = tag.getTagName(); if (tagName.startsWith("Unknown")) { continue; } String description = tag.getDescription(); if (description != null && description.startsWith("Unknown")) { continue; } nodes.add(new TagNode(tagName, description, tagIndex)); tagIndex++; } }
public void handle(Directory directory, Metadata metadata) throws MetadataException { if (directory.getTags() != null) { for (Tag tag : directory.getTags()) { metadata.set(tag.getTagName(), tag.getDescription()); } } } }
String tagName = tag.getTagName(); String directoryName = directory.getName(); String description = tag.getDescription();
public void handle(Directory directory, Metadata metadata) throws MetadataException { if (directory.getTags() != null) { for (Tag tag : directory.getTags()) { metadata.set(tag.getTagName(), tag.getDescription()); } } } }
/** * A basic representation of the tag's type and value. EG: <code>[Exif IFD0] FNumber - f/2.8</code>. * * @return the tag's type and value */ @Override @NotNull public String toString() { String description = getDescription(); if (description == null) description = _directory.getString(getTagType()) + " (unable to formulate description)"; return "[" + _directory.getName() + "] " + getTagName() + " - " + description; } }
@Override public void onExtractionSuccess(@NotNull File file, @NotNull Metadata metadata, @NotNull String relativePath, @NotNull PrintStream log) { super.onExtractionSuccess(file, metadata, relativePath, log); // Iterate through all values, calling toString to flush out any formatting exceptions for (Directory directory : metadata.getDirectories()) { directory.getName(); for (Tag tag : directory.getTags()) { tag.getTagName(); tag.getDescription(); } } } }
private ExifMetadata getMetadataFromTag(Directory directory, Tag tag) throws MetadataException { ExifMetadata metadata = new ExifMetadata(); metadata.setDirectory(tag.getDirectoryName()); metadata.setKey(tag.getTagName()); metadata.setValue(tag.getDescription()); String values[]; Object value = directory.getObject(tag.getTagType()); if (value instanceof byte[]) { return null; } else if (value instanceof String) { values = new String[] {(String)value}; } else if (value instanceof String[]) { values = (String[])value; } else { values = new String[] {directory.getString(tag.getTagType())}; } values = decodeValues(values); metadata.setValues(values); return metadata; }