include filename in exception

This commit is contained in:
Erik Forkalsrud 2009-05-03 14:12:27 -07:00
parent 0f7263d9d0
commit eb2ee980e5

View file

@ -194,9 +194,6 @@ public class DirectoryEntry extends Entry {
Metadata metadata; Metadata metadata;
try { try {
metadata = JpegMetadataReader.readMetadata(f); metadata = JpegMetadataReader.readMetadata(f);
} catch (Exception e) {
throw new RuntimeException("problem reading file " + f.getPath(), e);
}
Directory exifDirectory = metadata.getDirectory(ExifDirectory.class); Directory exifDirectory = metadata.getDirectory(ExifDirectory.class);
if (exifDirectory.containsTag(ExifDirectory.TAG_ORIENTATION)) { if (exifDirectory.containsTag(ExifDirectory.TAG_ORIENTATION)) {
int orientation = exifDirectory.getInt(ExifDirectory.TAG_ORIENTATION); int orientation = exifDirectory.getInt(ExifDirectory.TAG_ORIENTATION);
@ -227,6 +224,9 @@ public class DirectoryEntry extends Entry {
props.setProperty(base + "dimensions", new Dimension(width, height).toString()); props.setProperty(base + "dimensions", new Dimension(width, height).toString());
hasDim = true; hasDim = true;
} }
} catch (Exception e) {
throw new RuntimeException("problem reading file " + f.getPath(), e);
}
props.setProperty(base + "etag", Integer.toHexString(name.hashCode() + Long.valueOf(f.lastModified()).hashCode())); props.setProperty(base + "etag", Integer.toHexString(name.hashCode() + Long.valueOf(f.lastModified()).hashCode()));
if (!hasDate) { if (!hasDate) {
props.setProperty(base + "captureDate", sdf.format(new Date(f.lastModified()))); props.setProperty(base + "captureDate", sdf.format(new Date(f.lastModified())));