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


Java Directory.getErrors方法代码示例

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


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

示例1: MetadataProcessor

import com.drew.metadata.Directory; //导入方法依赖的package包/类
public MetadataProcessor(File imageFile) {
    this.imageFile = imageFile;
    try {
        data = ImageMetadataReader.readMetadata(imageFile);
    } catch (Exception ex) {
        Logger.getLogger(MetadataProcessor.class.getName()).log(Level.SEVERE, null, ex);
    }
    
    for (Directory directory : data.getDirectories()) {
        extracted_data += String.format("----------------------------------------------%15s---------------------------------\n", directory.getName());
        for (Tag tag : directory.getTags()) {
            extracted_data += tag + "\n";
        }
        if (directory.hasErrors()) {
            for (String error : directory.getErrors()) {
                System.err.println("ERROR: " + error);
            }
        }
    }
}
 
开发者ID:afsalashyana,项目名称:FakeImageDetection,代码行数:21,代码来源:MetadataProcessor.java

示例2: onExtractionSuccess

import com.drew.metadata.Directory; //导入方法依赖的package包/类
public void onExtractionSuccess(@NotNull File file, @NotNull Metadata metadata, @NotNull String relativePath, @NotNull PrintStream log)
{
    if (metadata.hasErrors()) {
        log.print(file);
        log.print('\n');
        for (Directory directory : metadata.getDirectories()) {
            if (!directory.hasErrors())
                continue;
            for (String error : directory.getErrors()) {
                log.printf("\t[%s] %s\n", directory.getName(), error);
                _errorCount++;
            }
        }
    }
}
 
开发者ID:drewnoakes,项目名称:metadata-extractor,代码行数:16,代码来源:ProcessAllImagesInFolderUtility.java

示例3: onExtracted

import com.drew.metadata.Directory; //导入方法依赖的package包/类
public void onExtracted(@NotNull File file, @NotNull Metadata metadata)
{
    if (metadata.hasErrors()) {
        System.err.println(file);
        for (Directory directory : metadata.getDirectories()) {
            if (!directory.hasErrors())
                continue;
            for (String error : directory.getErrors()) {
                System.err.printf("\t[%s] %s%n", directory.getName(), error);
                _errorCount++;
            }
        }
    }
}
 
开发者ID:byronb92,项目名称:ImageEXIFExtraction,代码行数:15,代码来源:ProcessAllImagesInFolderUtility.java

示例4: outputMetadata

import com.drew.metadata.Directory; //导入方法依赖的package包/类
private static void outputMetadata(ContentHandlerHelper helper, Metadata metadata, String elementName) throws MetadataException {
    if (metadata.getDirectoryCount() > 0) {
        for (Iterator j = metadata.getDirectoryIterator(); j.hasNext();) {
            Directory directory = (Directory) j.next();

            helper.startElement(elementName, new String[]{"name", directory.getName()});

            for (Iterator k = directory.getTagIterator(); k.hasNext();) {
                Tag tag = (Tag) k.next();
                helper.startElement(TAG_ELEMENT);
                helper.element("id", tag.getTagType());
                helper.element("name", tag.getTagName());
                helper.element("value", tag.getDescription());
                helper.endElement();
            }
            // TODO: Should do something with this?
            if (directory.hasErrors()) {
                for (Iterator k = directory.getErrors(); k.hasNext();) {
                    //System.out.println("ERROR: " + k.next());
                }
            }

            helper.endElement();
        }
    }
}
 
开发者ID:evlist,项目名称:orbeon-forms,代码行数:27,代码来源:DirectoryScannerProcessor.java

示例5: printImageTags

import com.drew.metadata.Directory; //导入方法依赖的package包/类
private void printImageTags(int approachCount, Metadata metadata)
{
    System.out.println();
    System.out.println("*** APPROACH " + approachCount + " ***");
    System.out.println();
    // iterate over the exif data and print to System.out
    Iterator directories = metadata.getDirectoryIterator();
    while (directories.hasNext()) {
        Directory directory = (Directory)directories.next();
        Iterator tags = directory.getTagIterator();
        while (tags.hasNext()) {
            Tag tag = (Tag)tags.next();
            System.out.println(tag);
        }
        if (directory.hasErrors()) {
            Iterator errors = directory.getErrors();
            while (errors.hasNext()) {
                System.out.println("ERROR: " + errors.next());
            }
        }
    }
}
 
开发者ID:ecologylab,项目名称:BigSemanticsJava,代码行数:23,代码来源:SampleUsage.java

示例6: print

import com.drew.metadata.Directory; //导入方法依赖的package包/类
private static void print(Metadata metadata)
{
    System.out.println("-------------------------------------");

    // Iterate over the data and print to System.out

    //
    // A Metadata object contains multiple Directory objects
    //
    for (Directory directory : metadata.getDirectories()) {

        //
        // Each Directory stores values in Tag objects
        //
        for (Tag tag : directory.getTags()) {
            System.out.println(tag);
        }

        //
        // Each Directory may also contain error messages
        //
        if (directory.hasErrors()) {
            for (String error : directory.getErrors()) {
                System.err.println("ERROR: " + error);
            }
        }
    }
}
 
开发者ID:MPDL,项目名称:LabCam,代码行数:29,代码来源:DeviceStatus.java


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