當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。