当前位置: 首页>>代码示例>>Java>>正文


Java ExifIFD0Directory.getDescription方法代码示例

本文整理汇总了Java中com.drew.metadata.exif.ExifIFD0Directory.getDescription方法的典型用法代码示例。如果您正苦于以下问题:Java ExifIFD0Directory.getDescription方法的具体用法?Java ExifIFD0Directory.getDescription怎么用?Java ExifIFD0Directory.getDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.drew.metadata.exif.ExifIFD0Directory的用法示例。


在下文中一共展示了ExifIFD0Directory.getDescription方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: Row

import com.drew.metadata.exif.ExifIFD0Directory; //导入方法依赖的package包/类
Row(@NotNull File file, @NotNull Metadata metadata)
{
    this.file = file;
    this.metadata = metadata;

    ExifIFD0Directory ifd0Dir = metadata.getDirectory(ExifIFD0Directory.class);
    ExifSubIFDDirectory subIfdDir = metadata.getDirectory(ExifSubIFDDirectory.class);
    ExifThumbnailDirectory thumbDir = metadata.getDirectory(ExifThumbnailDirectory.class);
    if (ifd0Dir != null) {
        manufacturer = ifd0Dir.getDescription(ExifIFD0Directory.TAG_MAKE);
        model = ifd0Dir.getDescription(ExifIFD0Directory.TAG_MODEL);
    }
    boolean hasMakernoteData = false;
    if (subIfdDir != null) {
        exifVersion = subIfdDir.getDescription(ExifSubIFDDirectory.TAG_EXIF_VERSION);
        hasMakernoteData = subIfdDir.containsTag(ExifSubIFDDirectory.TAG_MAKERNOTE);
    }
    if (thumbDir != null) {
        Integer width = thumbDir.getInteger(ExifThumbnailDirectory.TAG_THUMBNAIL_IMAGE_WIDTH);
        Integer height = thumbDir.getInteger(ExifThumbnailDirectory.TAG_THUMBNAIL_IMAGE_HEIGHT);
        thumbnail = width != null && height != null
            ? String.format("Yes (%s x %s)", width, height)
            : "Yes";
    }
    for (Directory directory : metadata.getDirectories()) {
        if (directory.getClass().getName().contains("Makernote")) {
            makernote = directory.getName().replace("Makernote", "").trim();
        }
    }
    if (makernote == null) {
        makernote = hasMakernoteData ? "(Unknown)" : "N/A";
    }
}
 
开发者ID:byronb92,项目名称:ImageEXIFExtraction,代码行数:34,代码来源:ProcessAllImagesInFolderUtility.java

示例2: Row

import com.drew.metadata.exif.ExifIFD0Directory; //导入方法依赖的package包/类
Row(@NotNull File file, @NotNull Metadata metadata, @NotNull String relativePath)
{
    this.file = file;
    this.metadata = metadata;
    this.relativePath = relativePath;

    ExifIFD0Directory ifd0Dir = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class);
    ExifSubIFDDirectory subIfdDir = metadata.getFirstDirectoryOfType(ExifSubIFDDirectory.class);
    ExifThumbnailDirectory thumbDir = metadata.getFirstDirectoryOfType(ExifThumbnailDirectory.class);
    if (ifd0Dir != null) {
        manufacturer = ifd0Dir.getDescription(ExifIFD0Directory.TAG_MAKE);
        model = ifd0Dir.getDescription(ExifIFD0Directory.TAG_MODEL);
    }
    boolean hasMakernoteData = false;
    if (subIfdDir != null) {
        exifVersion = subIfdDir.getDescription(ExifSubIFDDirectory.TAG_EXIF_VERSION);
        hasMakernoteData = subIfdDir.containsTag(ExifSubIFDDirectory.TAG_MAKERNOTE);
    }
    if (thumbDir != null) {
        Integer width = thumbDir.getInteger(ExifThumbnailDirectory.TAG_IMAGE_WIDTH);
        Integer height = thumbDir.getInteger(ExifThumbnailDirectory.TAG_IMAGE_HEIGHT);
        thumbnail = width != null && height != null
            ? String.format("Yes (%s x %s)", width, height)
            : "Yes";
    }
    for (Directory directory : metadata.getDirectories()) {
        if (directory.getClass().getName().contains("Makernote")) {
            makernote = directory.getName().replace("Makernote", "").trim();
            break;
        }
    }
    if (makernote == null) {
        makernote = hasMakernoteData ? "(Unknown)" : "N/A";
    }
}
 
开发者ID:drewnoakes,项目名称:metadata-extractor,代码行数:36,代码来源:ProcessAllImagesInFolderUtility.java


注:本文中的com.drew.metadata.exif.ExifIFD0Directory.getDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。