6b27ea
diff --git a/configure.ac b/configure.ac
6b27ea
index d18859b..d6dc63b 100644
6b27ea
--- a/configure.ac
6b27ea
+++ b/configure.ac
6b27ea
@@ -971,25 +971,6 @@ AM_CONDITIONAL(HAVE_SPIRO, test "$spiro_ok" = "yes")
6b27ea
 
6b27ea
 AC_SUBST(LIBSPIRO)
6b27ea
 
6b27ea
-###################
6b27ea
-# Check for exiv2
6b27ea
-###################
6b27ea
-
6b27ea
-AC_ARG_WITH(exiv2, [  --without-exiv2         build without libexiv2 support])
6b27ea
-
6b27ea
-have_libexiv2="no"
6b27ea
-if test "x$with_libexiv2" != "xno"; then
6b27ea
-  PKG_CHECK_MODULES(EXIV2, exiv2,
6b27ea
-    have_exiv2="yes",
6b27ea
-    have_exiv2="no  (exiv2 library not found)")
6b27ea
-fi
6b27ea
-
6b27ea
-AM_CONDITIONAL(HAVE_EXIV2, test "$have_exiv2" = "yes")
6b27ea
-
6b27ea
-AC_SUBST(EXIV2_CFLAGS)
6b27ea
-AC_SUBST(EXIV2_CXXFLAGS)
6b27ea
-AC_SUBST(EXIV2_LIBS)
6b27ea
-
6b27ea
 ###################
6b27ea
 # Check for UMFPACK
6b27ea
 ###################
6b27ea
diff --git a/tools/Makefile.am b/tools/Makefile.am
6b27ea
index 8f1077d..93d83fc 100644
6b27ea
--- a/tools/Makefile.am
6b27ea
+++ b/tools/Makefile.am
6b27ea
@@ -26,9 +26,9 @@ AM_LDFLAGS = \
6b27ea
 
6b27ea
 noinst_PROGRAMS = introspect operation_reference img_cmp
6b27ea
 
6b27ea
-if HAVE_EXIV2
6b27ea
+if HAVE_GEXIV2
6b27ea
 noinst_PROGRAMS     += exp_combine 
6b27ea
 exp_combine_SOURCES  = exp_combine.cpp
6b27ea
-exp_combine_LDADD    = $(EXIV2_LIBS) 
6b27ea
-exp_combine_CXXFLAGS = $(AM_CFLAGS) $(EXIV2_CFLAGS)
6b27ea
+exp_combine_LDADD    = $(GEXIV2_LIBS) 
6b27ea
+exp_combine_CXXFLAGS = $(AM_CFLAGS) $(GEXIV2_CFLAGS)
6b27ea
 endif
6b27ea
diff --git a/tools/exp_combine.cpp b/tools/exp_combine.cpp
6b27ea
index efd8e3c..58649b6 100644
6b27ea
--- a/tools/exp_combine.cpp
6b27ea
+++ b/tools/exp_combine.cpp
6b27ea
@@ -8,8 +8,7 @@
6b27ea
 
6b27ea
 #include <iostream>
6b27ea
 
6b27ea
-#include <exiv2/image.hpp>
6b27ea
-#include <exiv2/exif.hpp>
6b27ea
+#include <gexiv2/gexiv2.h>
6b27ea
 
6b27ea
 using namespace std;
6b27ea
 
6b27ea
@@ -54,35 +53,32 @@ die:
6b27ea
 static gfloat
6b27ea
 expcombine_get_file_ev (const gchar *path)
6b27ea
 {
6b27ea
-  /* Open the file and read in the metadata */
6b27ea
-  Exiv2::Image::AutoPtr image;
6b27ea
-  try 
6b27ea
-    {
6b27ea
-      image = Exiv2::ImageFactory::open (path);
6b27ea
-      image->readMetadata ();
6b27ea
-    }
6b27ea
-  catch (Exiv2::Error ex)
6b27ea
-    {
6b27ea
-      g_print ("Error: unable to read metadata from path: '%s'\n", path);
6b27ea
-      exit (EXIT_FAILURE);
6b27ea
-    }
6b27ea
+  GError *error = NULL;
6b27ea
+  GExiv2Metadata *e2m = gexiv2_metadata_new ();
6b27ea
+  gfloat time, aperture, gain = 1.0f;
6b27ea
 
6b27ea
-  Exiv2::ExifData &exifData = image->exifData ();
6b27ea
-  if (exifData.empty ())
6b27ea
-      return NAN;
6b27ea
+  gexiv2_metadata_open_path (e2m, path, &error);
6b27ea
+  if (error)
6b27ea
+  {
6b27ea
+    g_warning ("%s", error->message);
6b27ea
+    exit (EXIT_FAILURE);
6b27ea
+  }
6b27ea
 
6b27ea
   /* Calculate the APEX brightness / EV */
6b27ea
-  gfloat time, aperture, gain = 1.0f;
6b27ea
 
6b27ea
-  time     = exifData["Exif.Photo.ExposureTime"].value().toFloat();
6b27ea
-  aperture = exifData["Exif.Photo.FNumber"     ].value().toFloat();
6b27ea
+  {
6b27ea
+    gint nom, den;
6b27ea
+    gexiv2_metadata_get_exposure_time (e2m, &nom, &den;;
6b27ea
+    time = nom * 1.0f / den;
6b27ea
+  }
6b27ea
+  aperture = gexiv2_metadata_get_fnumber (e2m);
6b27ea
 
6b27ea
   /* iso */
6b27ea
-  try
6b27ea
+  if (gexiv2_metadata_has_tag (e2m, "Exif.Image.ISOSpeedRatings"))
6b27ea
     {
6b27ea
-      gain = exifData["Exif.Photo.ISOSpeedRatings"].value().toLong() / 100.0f;
6b27ea
+      gain = gexiv2_metadata_get_iso_speed (e2m) / 100.0f;
6b27ea
     }
6b27ea
-  catch (Exiv2::Error ex)
6b27ea
+  else
6b27ea
     {
6b27ea
       // Assume ISO is set at 100. It's reasonably likely that the ISO is the
6b27ea
       // same across all images anyway, and for our purposes the relative