I need to get the EXIF information from a series of image files (about 200). In particular, the gps information. I have an app which was working using the inline java - meta-extractor-2.6.2, as detailed in this post.
I have two cameras, a Nikon D90 and a D200. The D90 is not problem a but the D200 causes a crash with an error which I cannot understand (will post later as I have no files to test at work). Looking at the EXIF information with Irfanview, both files are readable and the format of both sets of EXIF data seem to be the same.
There is an update for the meta-extractor which I tried as is but no luck.
Is there another way? I have a workaround using Matlab but would like to use B4J.
Thanks in advance.
I have two cameras, a Nikon D90 and a D200. The D90 is not problem a but the D200 causes a crash with an error which I cannot understand (will post later as I have no files to test at work). Looking at the EXIF information with Irfanview, both files are readable and the format of both sets of EXIF data seem to be the same.
There is an update for the meta-extractor which I tried as is but no luck.
Is there another way? I have a workaround using Matlab but would like to use B4J.
Thanks in advance.
#If JAVA
import com.drew.imaging.*;
import com.drew.metadata.*;
import com.drew.lang.*;
import java.io.*;
import java.util.*;
public static List GetImgMeta(String filename)
{
File file = new File(filename);
List lstMeta = new ArrayList<Object>();
try {
Metadata metadata = ImageMetadataReader.readMetadata(file);
for (Directory directory : metadata.getDirectories()) {
for (Tag tag : directory.getTags()) {
lstMeta.add(tag.toString());
}
if (directory.hasErrors()) {
for (String error : directory.getErrors()) {
System.err.println("ERROR: " + error);
}
}
}
}
catch (ImageProcessingException e) {
// handle exception
lstMeta.add("ImageProcessingException");
}
catch (IOException e) {
// handle exception
lstMeta.add("IOException");
}
return(lstMeta);
}
#End If
import com.drew.imaging.*;
import com.drew.metadata.*;
import com.drew.lang.*;
import java.io.*;
import java.util.*;
public static List GetImgMeta(String filename)
{
File file = new File(filename);
List lstMeta = new ArrayList<Object>();
try {
Metadata metadata = ImageMetadataReader.readMetadata(file);
for (Directory directory : metadata.getDirectories()) {
for (Tag tag : directory.getTags()) {
lstMeta.add(tag.toString());
}
if (directory.hasErrors()) {
for (String error : directory.getErrors()) {
System.err.println("ERROR: " + error);
}
}
}
}
catch (ImageProcessingException e) {
// handle exception
lstMeta.add("ImageProcessingException");
}
catch (IOException e) {
// handle exception
lstMeta.add("IOException");
}
return(lstMeta);
}
#End If
Dim imgmeta As List = NativeMe.RunMethod("GetImgMeta", Array(fn))