Index: /trunk/src/org/openstreetmap/josm/tools/ExifReader.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/tools/ExifReader.java	(revision 9696)
+++ /trunk/src/org/openstreetmap/josm/tools/ExifReader.java	(revision 9697)
@@ -104,6 +104,6 @@
             final Metadata metadata = JpegMetadataReader.readMetadata(filename);
             final Directory dir = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class);
-            return dir.getInt(ExifIFD0Directory.TAG_ORIENTATION);
-        } catch (JpegProcessingException | MetadataException | IOException e) {
+            return dir == null ? null : dir.getInteger(ExifIFD0Directory.TAG_ORIENTATION);
+        } catch (JpegProcessingException | IOException e) {
             Main.error(e);
         }
@@ -122,9 +122,5 @@
             final GpsDirectory dirGps = metadata.getFirstDirectoryOfType(GpsDirectory.class);
             return readLatLon(dirGps);
-        } catch (JpegProcessingException e) {
-            Main.error(e);
-        } catch (IOException e) {
-            Main.error(e);
-        } catch (MetadataException e) {
+        } catch (JpegProcessingException | IOException | MetadataException e) {
             Main.error(e);
         }
@@ -160,7 +156,5 @@
             final GpsDirectory dirGps = metadata.getFirstDirectoryOfType(GpsDirectory.class);
             return readDirection(dirGps);
-        } catch (JpegProcessingException e) {
-            Main.error(e);
-        } catch (IOException e) {
+        } catch (JpegProcessingException | IOException e) {
             Main.error(e);
         }
