Exif reporting no longer prints "null" for blanks.

This commit is contained in:
0xNF 2012-09-19 15:09:46 -04:00
parent c6ce06928c
commit 3dba9afcc5
2 changed files with 31 additions and 13 deletions

View File

@ -117,12 +117,16 @@ public final class ExifParserFileIngestModule implements IngestModuleAbstractFil
// GPS Stuff
GpsDirectory gpsDir = metadata.getDirectory(GpsDirectory.class);
String latitude, latRef, longitude, longRef, altitude;
latitude = latRef = longitude = longRef = altitude = "";
if(gpsDir != null) {
String latitude = gpsDir.getString(GpsDirectory.TAG_GPS_LATITUDE);
String latRef = gpsDir.getString(GpsDirectory.TAG_GPS_LATITUDE_REF);
String longitude = gpsDir.getString(GpsDirectory.TAG_GPS_LONGITUDE);
String longRef = gpsDir.getString(GpsDirectory.TAG_GPS_LONGITUDE_REF);
String altitude = gpsDir.getString(GpsDirectory.TAG_GPS_ALTITUDE);
latitude = gpsDir.getString(GpsDirectory.TAG_GPS_LATITUDE);
latRef = gpsDir.getString(GpsDirectory.TAG_GPS_LATITUDE_REF);
longitude = gpsDir.getString(GpsDirectory.TAG_GPS_LONGITUDE);
longRef = gpsDir.getString(GpsDirectory.TAG_GPS_LONGITUDE_REF);
altitude = gpsDir.getString(GpsDirectory.TAG_GPS_ALTITUDE);
}
if(latitude!= null && latRef!=null) {
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_GEO_LATITUDE.getTypeID(), MODULE_NAME, latitude + " " + latRef));
@ -131,7 +135,8 @@ public final class ExifParserFileIngestModule implements IngestModuleAbstractFil
} if(altitude!=null) {
attributes.add(new BlackboardAttribute(ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE.getTypeID(), MODULE_NAME, altitude));
}
}
// Device info
ExifIFD0Directory devDir = metadata.getDirectory(ExifIFD0Directory.class);

View File

@ -39,6 +39,7 @@ import org.sleuthkit.autopsy.casemodule.Case;
import org.sleuthkit.autopsy.ingest.IngestManager;
import org.sleuthkit.datamodel.*;
import java.io.File;
import java.util.Collection;
import java.util.List;
/**
@ -425,12 +426,24 @@ public class ReportHTML implements ReportModule {
logger.log(Level.WARNING, "Could not get file name attrached to EXIF artifact!", e);
artifact.append("<tr").append(altRow).append("><td>").append("Error");
}
artifact.append("<td>").append(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID())).append("</td>");
artifact.append("<td>").append(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DEVICE_MAKE.getTypeID())).append("</td>");
artifact.append("<td>").append(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DEVICE_MODEL.getTypeID())).append("</td>");
artifact.append("<td>").append(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE.getTypeID())).append("</td>");
artifact.append("<td>").append(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE.getTypeID())).append("</td>");
artifact.append("<td>").append(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE.getTypeID())).append("</td>");
Collection<String> bbats = new ArrayList<String>();
bbats.add(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DATETIME.getTypeID()));
bbats.add(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DEVICE_MAKE.getTypeID()));
bbats.add(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_DEVICE_MODEL.getTypeID()));
bbats.add(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LATITUDE.getTypeID()));
bbats.add(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_LONGITUDE.getTypeID()));
bbats.add(attributes.get(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_GEO_ALTITUDE.getTypeID()));
for(String s : bbats){
String modified = "";
if(s != null && !s.equals("null")){
modified = s;
}
artifact.append("<td>").append(modified).append("</td>");
}
artifact.append("</tr>");
nodeExif.append(artifact);
}