gthumb r2180 - in trunk: . libgthumb



Author: mjc
Date: Fri Jan 11 16:45:18 2008
New Revision: 2180
URL: http://svn.gnome.org/viewvc/gthumb?rev=2180&view=rev

Log:
2008-01-11  Michael J. Chudobiak  <mjc svn gnome org>

        * NEWS:
        * README:
        * configure.in:
        * libgthumb/gth-exiv2-utils.cpp:
        Make exiv2 mandatory, 0.15 or higher. Check for version 0.16,
        which has XMP support.



Modified:
   trunk/ChangeLog
   trunk/NEWS
   trunk/README
   trunk/configure.in
   trunk/libgthumb/gth-exiv2-utils.cpp

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Fri Jan 11 16:45:18 2008
@@ -56,6 +56,9 @@
 	* Added strftime format codes to the scripting feature.
 	* Initial support for the exiv2 metadata-reading library.
 
+	Library changes:
+	* exiv2 0.15 or higher is now required.
+
 
 version 2.10.8
 --------------

Modified: trunk/README
==============================================================================
--- trunk/README	(original)
+++ trunk/README	Fri Jan 11 16:45:18 2008
@@ -94,6 +94,7 @@
 	* libglade 		version >= 2.4.0
 	* intltool		version >= 0.35.0
 	* libexif               version >= 0.6.13
+	* exiv2			version >= 0.15
 	* libjpeg
 	* gtkunique		version >= 0.9.1 (optional)
 
@@ -112,6 +113,8 @@
   If dcraw is present (and is in your executable search path), 
   gthumb can view full RAW photos.
 
+  If exiv2 version 0.16 or higher is present, you can read XMP metadata.
+
   If pfstools and pfstmo are installed, gthumb can view HDR images. 
   See http://www.mpi-inf.mpg.de/resources/pfstools.
   To view OpenEXR files with pfstools, the OpenEXR libraries need

Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in	(original)
+++ trunk/configure.in	Fri Jan 11 16:45:18 2008
@@ -35,7 +35,7 @@
 LIBGPHOTO_REQUIRED=2.1.3
 BONOBO_REQUIRED=2.6.0
 LIBOPENRAW_REQUIRED=0.0.2
-EXIV2_REQUIRED=0.16
+EXIV2_REQUIRED=0.15
 GSTREAMER_REQUIRED=0.10.0
 
 AC_SUBST(GLIB_REQUIRED)
@@ -72,6 +72,7 @@
 	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
 	gnome-vfs-module-2.0				\
 	libexif >= $LIBEXIF_REQUIRED                    \
+	exiv2 >= $EXIV2_REQUIRED			\
 	libxml-2.0 >= $LIBXML_REQUIRED			\
 	libglade-2.0 >= $LIBGLADE_REQUIRED)
 AC_SUBST(GTHUMB_LIBS)
@@ -247,18 +248,11 @@
 
 
 #
-# check for exiv2
+# check for exiv2 xmp functionality
 #
-AC_ARG_ENABLE([exiv2],
-              [AC_HELP_STRING([--disable-exiv2], [Disable exiv2 metadata extraction])],,
-              [enable_exiv2=yes])
-HAVE_EXIV2=no
-if test "x$enable_exiv2" = "xyes"; then
-   PKG_CHECK_MODULES(EXIV2, exiv2 >= $EXIV2_REQUIRED,
-                     [AC_DEFINE(HAVE_EXIV2, 1, [Define to 1 to enable exiv2 support])
-                      HAVE_EXIV2=yes],
-                     [HAVE_EXIV2=no])
-fi
+AC_LANG_PUSH([C++])
+AC_CHECK_HEADERS([exiv2/xmp.hpp],[HAVE_XMP=yes],[HAVE_XMP=no])
+AC_LANG_POP([C++])
 
 
 #
@@ -399,7 +393,7 @@
 	Have libtiff:             ${HAVE_TIFF}
 	Have libgphoto:           ${HAVE_GPHOTO2}
 	Have libopenraw:          ${HAVE_LIBOPENRAW}
-	Have exiv2:               ${HAVE_EXIV2}
+	Have exiv2 xmp support:   ${HAVE_XMP}
 	Have gstreamer:           ${HAVE_GSTREAMER}
 
 "

Modified: trunk/libgthumb/gth-exiv2-utils.cpp
==============================================================================
--- trunk/libgthumb/gth-exiv2-utils.cpp	(original)
+++ trunk/libgthumb/gth-exiv2-utils.cpp	Fri Jan 11 16:45:18 2008
@@ -23,7 +23,6 @@
 #include "gth-exiv2-utils.hpp"
 
 #include <exiv2/basicio.hpp>
-#include <exiv2/xmp.hpp>
 #include <exiv2/error.hpp>
 #include <exiv2/image.hpp>
 #include <exiv2/exif.hpp>
@@ -33,6 +32,9 @@
 #include <vector>
 #include <iomanip>
 
+#ifdef HAVE_XMP
+#include <exiv2/xmp.hpp>
+#endif
 
 using namespace std;
 
@@ -152,6 +154,7 @@
 			}
 		}
 
+#ifdef HAVE_XMP
 		Exiv2::XmpData &xmpData = image->xmpData();
 		if (!xmpData.empty()) {
 
@@ -173,6 +176,7 @@
 				metadata = add (metadata, name.str().c_str(), value.str().c_str(), cat);
 			}
 		}
+#endif
 
 		return metadata;
 	}
@@ -188,6 +192,7 @@
 read_exiv2_sidecar (const char *uri, GList *metadata)
 {
 	try {
+#ifdef HAVE_XMP
 	        Exiv2::DataBuf buf = Exiv2::readFile(uri);
         	std::string xmpPacket;
 	        xmpPacket.assign(reinterpret_cast<char*>(buf.pData_), buf.size_);
@@ -217,6 +222,7 @@
 			}
 		}
 	        Exiv2::XmpParser::terminate();
+#endif
 	        return metadata;
 	} 
 	catch (Exiv2::AnyError& e) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]