jokiazhang / metadata-extractor

Automatically exported from code.google.com/p/metadata-extractor
0 stars 0 forks source link

NoSuchMethodError #82

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Problem with metadata-extractor version 2.6.4

After I use the ImageMetadataReader to create a Metadata object, when I try to 
get the directories I get the following output:
Number of Directories: 3
Exception in thread "main" java.lang.NoSuchMethodError: Exception in thread 
"main" java.lang.NoSuchMethodError: 
com.drew.metadata.Metadata.getDirectories()Ljava/lang/Iterable;
    at TestingClass.main(TestingClass.java:19)

Here is the code:
public class TestingClass {
    public static void main(String[] args){
        File jpegFile = new File("C:\\crawler_data\\data50\\1ce76f40c94f263aec9f1c9c37de9a61.jpg");
        Metadata metadata = null;
        try{
            metadata = ImageMetadataReader.readMetadata(jpegFile);
        } catch (Exception e){
            System.out.println("Error");
        }
        if (metadata != null){
            System.out.println("Number of Directories: " + metadata.getDirectoryCount());
            Iterable<Directory> directories = metadata.getDirectories();  //line 19
            for (Directory directory : directories) {
                for (Tag tag : directory.getTags()) {
                    System.out.println(tag);
                }
            }
        }
    }
}

The image used is attached.

Original issue reported on code.google.com by aT5y3...@gmail.com on 7 Jun 2013 at 6:19

Attachments:

GoogleCodeExporter commented 8 years ago
Cannot reproduce.

Original comment by drewnoakes on 19 Nov 2014 at 6:28