com.drew.metadata.Directory.getDescription()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中com.drew.metadata.Directory.getDescription()方法的一些代码示例,展示了Directory.getDescription()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Directory.getDescription()方法的具体详情如下:
包路径:com.drew.metadata.Directory
类名称:Directory
方法名:getDescription

Directory.getDescription介绍

[英]Provides a description of a tag's value using the descriptor set by setDescriptor(Descriptor).
[中]使用setDescriptor(Descriptor)设置的描述符提供标记值的说明。

代码示例

代码示例来源:origin: drewnoakes/metadata-extractor

/**
 * Get a description of the tag's value, considering enumerated values
 * and units.
 *
 * @return a description of the tag's value
 */
@Nullable
public String getDescription()
{
  return _directory.getDescription(_tagType);
}

代码示例来源:origin: apache/tika

String flash = directory.getDescription(ExifSubIFDDirectory.TAG_FLASH);
if (flash != null) {
  if (flash.contains("Flash fired")) {
metadata.set(Metadata.RESOLUTION_UNIT, directory.getDescription(ExifIFD0Directory.TAG_RESOLUTION_UNIT));
    trimPixels(directory.getDescription(ExifThumbnailDirectory.TAG_IMAGE_WIDTH)));
    trimPixels(directory.getDescription(ExifThumbnailDirectory.TAG_IMAGE_HEIGHT)));

代码示例来源:origin: com.drewnoakes/metadata-extractor

/**
 * Get a description of the tag's value, considering enumerated values
 * and units.
 *
 * @return a description of the tag's value
 */
@Nullable
public String getDescription()
{
  return _directory.getDescription(_tagType);
}

代码示例来源:origin: org.apache.drill.exec/drill-java-exec

public void setColorMode(Directory directory, int tagType) {
 String colorMode = directory.getDescription(tagType);
 if (colorMode != null) {
  setColorMode(colorMode);
 }
}

代码示例来源:origin: perfectsense/dari

private void populateMetadata(Metadata metadata) {
  for (Iterator<?> di = metadata.getDirectories().iterator(); di.hasNext();) {
    Directory directory = (Directory) di.next();
    Map<String, String> tags = new HashMap<String, String>();
    put(directory.getName(), tags);
    for (Iterator<?> ti = directory.getTags().iterator(); ti.hasNext();) {
      Tag tag = (Tag) ti.next();
      try {
        tags.put(tag.getTagName(), directory.getDescription(tag.getTagType()));
      } catch (Exception error) {
        errors.add(error);
      }
    }
  }
}

代码示例来源:origin: au.org.ala/image-utils

@Override
  public void extractMetadata(byte[] bytes, Map<String, String> md) {
    BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(bytes));
    try {
      Metadata metadata = ImageMetadataReader.readMetadata(bis, false);
      for (Directory directory : metadata.getDirectories()) {
        for (Tag tag : directory.getTags()) {
          String key = tag.getTagName();
          if (md.containsKey(key)) {
            key = String.format("%s (%s)", tag.getTagName(), tag.getDirectoryName());
          }
          String value = directory.getDescription(tag.getTagType());
          if (StringUtils.isNotEmpty(value) && value.startsWith("[") && value.endsWith("bytes]")) {
            byte[] tagBytes = directory.getByteArray(tag.getTagType());
            value = Base64.encodeBase64String(tagBytes);
          }
          md.put(key, value);
        }
      }
    } catch (Exception ex) {
      ex.printStackTrace();
    }
  }
}

代码示例来源:origin: com.github.lafa.tikaNoExternal/tika-parsers

String flash = directory.getDescription(ExifSubIFDDirectory.TAG_FLASH);
if (flash != null) {
  if (flash.contains("Flash fired")) {
metadata.set(Metadata.RESOLUTION_UNIT, directory.getDescription(ExifIFD0Directory.TAG_RESOLUTION_UNIT));
    trimPixels(directory.getDescription(ExifThumbnailDirectory.TAG_IMAGE_WIDTH)));
    trimPixels(directory.getDescription(ExifThumbnailDirectory.TAG_IMAGE_HEIGHT)));

代码示例来源:origin: org.apache.tika/tika-parsers

String flash = directory.getDescription(ExifSubIFDDirectory.TAG_FLASH);
if (flash != null) {
  if (flash.contains("Flash fired")) {
metadata.set(Metadata.RESOLUTION_UNIT, directory.getDescription(ExifIFD0Directory.TAG_RESOLUTION_UNIT));
    trimPixels(directory.getDescription(ExifThumbnailDirectory.TAG_IMAGE_WIDTH)));
    trimPixels(directory.getDescription(ExifThumbnailDirectory.TAG_IMAGE_HEIGHT)));

代码示例来源:origin: org.apache.drill.exec/drill-java-exec

Object value;
if (descriptive || isDescriptionTag(directory, tagType)) {
 value = directory.getDescription(tagType);
 if (directory instanceof PngDirectory) {
  if (((PngDirectory) directory).getPngChunkType().areMultipleAllowed()) {

相关文章