Index: MainWindow.h
===================================================================
--- MainWindow.h	(revision 9959)
+++ MainWindow.h	(working copy)
@@ -19,6 +19,10 @@
 class QGPS;
 class FeaturePainter;
 
+#ifdef GEOIMAGES
+class GeoImage;
+#endif
+
 class MainWindow : public QMainWindow, public Ui::MainWindow
 {
 	Q_OBJECT
Index: MainWindow.cpp
===================================================================
--- MainWindow.cpp	(revision 9959)
+++ MainWindow.cpp	(working copy)
@@ -46,6 +46,10 @@
 #include "QMapControl/mapadapter.h"
 #include "QMapControl/wmsmapadapter.h"
 
+#ifdef GEOIMAGE
+#include "Map/GeoImage.h"
+#endif
+
 #include "Render/NativeRenderDialog.h"
 #ifdef OSMARENDER
 	#include "Render/OsmaRenderDialog.h"
@@ -382,7 +386,7 @@
 	MerkaartorPreferences::instance()->setWorkingDir(QDir::currentPath());
 }
 
-
+#ifndef GEOIMAGE
 #define FILTER_OPEN_SUPPORTED \
 	tr("Supported formats (*.mdc *.gpx *.osm *.osb *.ngt *.nmea *.nme)\n" \
 	"Merkaartor document (*.mdc)\n" \
@@ -392,6 +396,18 @@
 	"Noni GPSPlot format (*.ngt)\n" \
 	"NMEA GPS log format (*.nmea *.nme)\n" \
 	"All Files (*)")
+#else
+#define FILTER_OPEN_SUPPORTED \
+	tr("Supported formats (*.mdc *.gpx *.osm *.osb *.ngt *.nmea *.nme)\n" \
+	"Merkaartor document (*.mdc)\n" \
+	"GPS Exchange format (*.gpx)\n" \
+	"OpenStreetMap format (*.osm)\n" \
+	"OpenStreetMap binary format (*.osb)\n" \
+	"Noni GPSPlot format (*.ngt)\n" \
+	"NMEA GPS log format (*.nmea *.nme)\n" \
+	"Geotagged images (*.jpg)\n" \
+	"All Files (*)")
+#endif
 #define FILTER_IMPORT_SUPPORTED \
 	tr("Supported formats (*.gpx *.osm *.osb *.ngt *.nmea *.nme)\n" \
 	"GPS Exchange format (*.gpx)\n" \
@@ -534,11 +550,22 @@
 
 void MainWindow::loadFiles(const QStringList & fileList)
 {
-	if (fileList.isEmpty())
-		return;
 
 	QStringList fileNames(fileList);
 
+#ifdef GEOIMAGE
+	QStringList images = fileList.filter(".jpg", Qt::CaseInsensitive);
+	if (!images.isEmpty()) {
+		GeoImage::loadImages(images, theDocument, theView);
+		QString cur;
+		foreach (cur, images)
+			fileNames.removeAll(cur);
+	}
+#endif
+	
+	if (fileNames.isEmpty())
+		return;
+
 	QApplication::setOverrideCursor(Qt::BusyCursor);
 	theLayers->setUpdatesEnabled(false);
 	view()->setUpdatesEnabled(false);
@@ -549,6 +576,7 @@
 	while (it.hasNext())
 	{
 		const QString & fn = it.next();
+
 		if (fn.endsWith(".mdc") == false)
 			continue;
 
Index: Merkaartor.pro
===================================================================
--- Merkaartor.pro	(revision 9959)
+++ Merkaartor.pro	(working copy)
@@ -8,6 +8,7 @@
 # PREFIX              - base prefix for installation
 # NODEBUG             - no debug target
 # OSMARENDER          - enable osmarender
+# GEOIMAGE            - enable geotagged images (needs exiv2)
 
 TEMPLATE = app
 TARGET = merkaartor
@@ -109,3 +110,9 @@
     }
     QT += webkit
 }
+
+count(GEOIMAGE, 1) {
+	DEFINES += GEOIMAGE
+	LIBS += -lexiv2
+	include(GeoImage.pri)
+}
Index: Map/ImportGPX.cpp
===================================================================
--- Map/ImportGPX.cpp	(revision 9959)
+++ Map/ImportGPX.cpp	(working copy)
@@ -88,6 +88,7 @@
 		if (!t.isNull() && t.tagName() == "trkpt")
 		{
 			TrackPoint* Pt = importTrkPt(t,theDocument, theLayer, theList);
+			Pt->setParent(S);
 			if (MakeSegment)
 				S->add(Pt);
 			progress.setValue(progress.value()+1);
