Index: configure.in
===================================================================
--- configure.in	(revision 1293)
+++ configure.in	(working copy)
@@ -5,6 +5,7 @@
 AC_INIT(gthumb, 2.9.1, http://bugzilla.gnome.org/enter_bug.cgi?product=gthumb)
 AC_CONFIG_SRCDIR(src/main.c)
 AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
+AM_MAINTAINER_MODE
 
 AM_CONFIG_HEADER(config.h)
 
@@ -34,6 +35,7 @@
 LIBIPTCDATA_REQUIRED=0.2.1
 LIBGPHOTO_REQUIRED=2.1.3
 GTKUNIQUE_REQUIRED=0.9.1
+LIBOPENRAW_REQUIRED=0.0.2
 
 AC_SUBST(GLIB_REQUIRED)
 AC_SUBST(GTK_REQUIRED)
@@ -47,7 +49,9 @@
 AC_SUBST(LIBIPTCDATA_REQUIRED)
 AC_SUBST(LIBGPHOTO_REQUIRED)
 AC_SUBST(GTKUNIQUE_REQUIRED)
+AC_SUBST(LIBOPENRAW_REQUIRED)
 
+
 dnl ===========================================================================
 
 PKG_CHECK_MODULES(GTHUMB,				\
@@ -239,6 +243,22 @@
                      [HAVE_GTKUNIQUE=no])
 fi
 
+#
+# Checks for libopenraw
+#
+AC_ARG_ENABLE([libopenraw],
+              [AC_HELP_STRING([--disable-libopenraw],[disable support for libopenraw])],,
+              [enable_libopenraw=yes])
+HAVE_LIBOPENRAW=no
+if test x$enable_libopenraw = xyes ; then
+   PKG_CHECK_MODULES(LIBOPENRAW, libopenraw-gnome-1.0 >= $LIBOPENRAW_REQUIRED,
+                     [AC_DEFINE(HAVE_LIBOPENRAW, 1, [Define to 1 to enable libopenraw support])
+                      HAVE_LIBOPENRAW=yes],
+                     [HAVE_LIBOPENRAW=no])
+fi
+                      
+
+
 dnl ###############################################
 
 
@@ -345,5 +365,6 @@
 	Have libtiff:             ${HAVE_TIFF}
 	Have libgphoto:           ${HAVE_GPHOTO2}
 	Have gtkunique:		  ${HAVE_GTKUNIQUE}
+	Have libopenraw:          ${HAVE_LIBOPENRAW}
 
 "
Index: libgthumb/file-utils.c
===================================================================
--- libgthumb/file-utils.c	(revision 1293)
+++ libgthumb/file-utils.c	(working copy)
@@ -680,7 +680,8 @@
 
 	/* If the description contains the word 'image' than we suppose
 	 * it is an image that gdk-pixbuf can load. */
-	is_an_image = strstr (result, "image") != NULL;
+	is_an_image = (strstr (result, "image") != NULL)
+		|| (strcmp(result, "application/x-crw") == 0);
 
 	return is_an_image;
 }
@@ -825,6 +826,12 @@
 	return image_is_type (name, "image/jpeg");
 }
 
+gboolean
+image_is_raw (const char *name)
+{
+	return image_is_type(name, "application/x-crw")
+		|| image_is_type (name, "image/x-dcraw");
+}
 
 gboolean
 image_is_gif (const char *name)
Index: libgthumb/file-utils.h
===================================================================
--- libgthumb/file-utils.h	(revision 1293)
+++ libgthumb/file-utils.h	(working copy)
@@ -112,6 +112,7 @@
 						   const gchar      *new_path);
 gboolean            file_unlink                   (const char       *path);
 gboolean            image_is_jpeg                 (const char       *name);
+gboolean            image_is_raw                  (const char       *name);
 gboolean            image_is_gif                  (const char       *name);
 gboolean            image_is_gif__accurate        (const char       *name);
 gboolean            path_is_file                  (const char       *s);
Index: libgthumb/thumb-loader.c
===================================================================
--- libgthumb/thumb-loader.c	(revision 1293)
+++ libgthumb/thumb-loader.c	(working copy)
@@ -4,6 +4,7 @@
  *  GThumb
  *
  *  Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+ *  Copyright (C) 2006-2007 Hubert Figuiere <hub@figuiere.net>
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -45,7 +46,11 @@
 #include "jpeg-utils.h"
 #include "gthumb-marshal.h"
 
+#ifdef HAVE_LIBOPENRAW
+#include <libopenraw-gnome/gdkpixbuf.h>
 
+#endif
+
 #define DEFAULT_MAX_FILE_SIZE (4*1024*1024)
 
 #define THUMBNAIL_LARGE_SIZE	256
@@ -257,7 +262,22 @@
 			debug (DEBUG_INFO, "PIXBUF == NULL\n");
 
 	} else
+#ifdef HAVE_LIBOPENRAW
+		if (image_is_raw(path))
 		{
+			ThumbLoader *tl = data;
+			ThumbLoaderPrivateData *priv = tl->priv;
+			GdkPixbuf *pixbuf = or_gdkpixbuf_extract_thumbnail(path, 
+									   priv->cache_max_w);
+			if (pixbuf != NULL) {
+				animation = gdk_pixbuf_non_anim_new (pixbuf);
+				g_object_unref (pixbuf);
+			}
+		}
+		else
+#endif
+
+		{
 			if (image_is_gif (path))
 				animation = gdk_pixbuf_animation_new_from_file (path, error);
 			else {
Index: libgthumb/Makefile.am
===================================================================
--- libgthumb/Makefile.am	(revision 1293)
+++ libgthumb/Makefile.am	(working copy)
@@ -14,6 +14,7 @@
 	$(GTHUMB_CFLAGS)					\
 	-DGTHUMB_MODULEDIR=\""$(libdir)/gthumb/modules"\"	\
 	-DGTHUMB_GLADEDIR=\""$(gladedir)"\"			\
+	$(LIBOPENRAW_CFLAGS)                                    \
 	$(DISABLE_DEPRECATED)
 
 libgthumbdir = $(libdir)
@@ -139,6 +140,7 @@
 	$(TIFF_LIBS)		\
 	$(GTHUMB_LIBS)		\
 	$(IPTCDATA_LIBS)	\
+	$(LIBOPENRAW_LIBS)      \
 	$(top_builddir)/libgthumb/jpegutils/libgthumb-jpegutils.la
 
 gthumb-marshal.h: gthumb-marshal.list $(GLIB_GENMARSHAL)
