Index: /trunk/data_nodist/README
===================================================================
--- /trunk/data_nodist/README	(revision 3261)
+++ /trunk/data_nodist/README	(revision 3261)
@@ -0,0 +1,18 @@
+exif-direction-example.jpg
+--------------------------
+
+Image that contains direction information in EXIF:
+
+...
+Exif.GPSInfo.GPSImgDirectionRef              Ascii       2  Magnetic direction
+Exif.GPSInfo.GPSImgDirection                 Rational    1  4650/100
+...
+exif-direction-example.jpg
+--------------------------
+
+Image that contains direction information in EXIF:
+
+...
+Exif.GPSInfo.GPSImgDirectionRef              Ascii       2  Magnetic direction
+Exif.GPSInfo.GPSImgDirection                 Rational    1  4650/100
+...
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 3260)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java	(revision 3261)
@@ -468,7 +468,33 @@
                     g.fillRect(p.x - d.width / 2, p.y - d.height / 2, d.width, d.height);
                 } else {
+                    if (e.getExifImgDir() != null) {
+                        double arrowlength = 25;
+                        double arrowwidth = 18;
+
+                        double dir = e.getExifImgDir();
+                        // Rotate 90° CCW 
+                        double headdir = ( dir < 90 ) ? dir + 270 : dir - 90;
+                        double leftdir = ( headdir < 90 ) ? headdir + 270 : headdir - 90;
+                        double rightdir = ( headdir > 270 ) ? headdir - 270 : headdir + 90;
+
+                        double ptx = p.x + Math.cos(Math.toRadians(headdir)) * arrowlength;
+                        double pty = p.y + Math.sin(Math.toRadians(headdir)) * arrowlength;
+
+                        double ltx = p.x + Math.cos(Math.toRadians(leftdir)) * arrowwidth/2;
+                        double lty = p.y + Math.sin(Math.toRadians(leftdir)) * arrowwidth/2;
+
+                        double rtx = p.x + Math.cos(Math.toRadians(rightdir)) * arrowwidth/2;
+                        double rty = p.y + Math.sin(Math.toRadians(rightdir)) * arrowwidth/2;
+
+                        g.setColor(Color.white);
+                        int[] xar = {(int) ltx, (int) ptx, (int) rtx, (int) ltx};
+                        int[] yar = {(int) lty, (int) pty, (int) rty, (int) lty};
+                        g.fillPolygon(xar, yar, 4);
+                    }
+
                     selectedIcon.paintIcon(mv, g,
                             p.x - selectedIcon.getIconWidth() / 2,
                             p.y - selectedIcon.getIconHeight() / 2);
+
                 }
             }
@@ -528,8 +554,22 @@
             }
 
+
+            // compass direction value
+
+            Rational direction = null;
+            
+            try {
+                direction = dir.getRational(GpsDirectory.TAG_GPS_IMG_DIRECTION);
+            } catch (CompoundException p) {
+                direction = null;
+            }
+
             // Store values
 
             e.setExifCoor(new LatLon(lat, lon));
             e.setPos(e.getExifCoor());
+            if (direction != null) {
+                e.setExifImgDir(direction.doubleValue());
+            }
 
         } catch (CompoundException p) {
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java	(revision 3260)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java	(revision 3261)
@@ -20,4 +20,5 @@
     private File file;
     private LatLon exifCoor;
+    private Double exifImgDir;
     private Date exifTime;
     Image thumbnail;
@@ -78,4 +79,8 @@
         return exifCoor;
     }
+    public Double getExifImgDir() {
+        return exifImgDir;
+    }
+
     /**
      * setter methods
@@ -105,4 +110,7 @@
         this.exifCoor = exifCoor;
     }
+    void setExifImgDir(double exifDir) {
+        this.exifImgDir = exifDir;
+    } 
 
     @Override
Index: /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java	(revision 3260)
+++ /trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageViewerDialog.java	(revision 3261)
@@ -239,4 +239,7 @@
                 osd.append(tr("\n{0} km/h", Math.round(entry.getSpeed())));
             }
+            if (entry.getExifImgDir() != null) {
+                osd.append(tr("\nDirection {0}°", Math.round(entry.getExifImgDir())));
+            }
             //if (entry.getPos()  != null) {
             //    osd.append(tr("\nlat: {0}, lon: {1}", Double.toString(entry.getPos().lat()), Double.toString(entry.getPos().lon())));
