diff --git a/configure.in b/configure.in
index d73a11f..a59393b 100644
--- a/configure.in
+++ b/configure.in
@@ -5,6 +5,7 @@ AC_PREREQ(2.52)
 AC_INIT(gthumb, 2.8.0, 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)
 
@@ -35,6 +36,7 @@ LIBEXIF_0_5_REQUIRED=0.5.12
 LIBEXIF_REQUIRED=0.6.9
 LIBIPTCDATA_REQUIRED=0.2.1
 LIBGPHOTO_REQUIRED=2.1.3
+LIBOPENRAW_REQUIRED=0.0.2
 
 AC_SUBST(GLIB_REQUIRED)
 AC_SUBST(GTK_REQUIRED)
@@ -51,6 +53,7 @@ AC_SUBST(LIBBONOBOUI_REQUIRED)
 AC_SUBST(LIBEXIF_REQUIRED)
 AC_SUBST(LIBIPTCDATA_REQUIRED)
 AC_SUBST(LIBGPHOTO_REQUIRED)
+AC_SUBST(LIBOPENRAW_REQUIRED)
 
 dnl ===========================================================================
 
@@ -278,6 +281,22 @@ if test x$enable_gphoto2 = xyes ; then
                      [HAVE_GPHOTO2=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 ###############################################
 
 IDL_MODULES="bonobo-activation-2.0 libbonobo-2.0 libbonoboui-2.0"
@@ -362,5 +381,6 @@ Configuration:
 	Have libjpeg:             ${HAVE_JPEG}
 	Have libtiff:             ${HAVE_TIFF}
 	Have libgphoto:           ${HAVE_GPHOTO2}
+	Have libopenraw:          ${HAVE_LIBOPENRAW}
 
 "
diff --git a/libgthumb/Makefile.am b/libgthumb/Makefile.am
index 4b6a324..028f121 100644
--- a/libgthumb/Makefile.am
+++ b/libgthumb/Makefile.am
@@ -11,8 +11,9 @@ gladedir = $(datadir)/gthumb/glade
 
 INCLUDES =							\
 	$(GTHUMB_CFLAGS)					\
	-DGTHUMB_MODULEDIR=\""$(libdir)/gthumb/modules"\"	\
 	-DGTHUMB_GLADEDIR=\""$(gladedir)"\"			\
+	$(LIBOPENRAW_CFLAGS)	\
 	$(DISABLE_DEPRECATED)
 
 libgthumbdir = $(libdir)/gthumb
@@ -131,6 +132,7 @@ libgthumb_la_SOURCES =			\
 libgthumb_la_LIBADD =		\
 	$(TIFF_LIBS)		\
 	$(GTHUMB_LIBS)		\
+	$(LIBOPENRAW_LIBS)      \
 	$(IPTCDATA_LIBS)
 
 gthumb-marshal.h: gthumb-marshal.list $(GLIB_GENMARSHAL)
diff --git a/libgthumb/file-utils.c b/libgthumb/file-utils.c
index e7908b1..ddb4148 100644
--- a/libgthumb/file-utils.c
+++ b/libgthumb/file-utils.c
@@ -676,7 +676,9 @@ file_is_image (const gchar *name,
 
 	/* 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;
+	g_debug("found file of type %s", result);
+	is_an_image = (strstr (result, "image") != NULL)
+		|| (strcmp(result, "application/x-crw") == 0);
 
 	return is_an_image;
 }
@@ -821,6 +823,13 @@ image_is_jpeg (const char *name)
 	return image_is_type (name, "image/jpeg");
 }
 
+gboolean
+image_is_raw (const char *name)
+{
+	g_debug("image_is_raw");
+	return image_is_type(name, "application/x-crw")
+		|| image_is_type (name, "image/x-dcraw");
+}
 
 gboolean 
 image_is_gif (const char *name)
diff --git a/libgthumb/file-utils.h b/libgthumb/file-utils.h
index b843bb4..110e9c1 100644
--- a/libgthumb/file-utils.h
+++ b/libgthumb/file-utils.h
@@ -112,6 +112,7 @@ gboolean            file_rename         
 						   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);
diff --git a/libgthumb/thumb-loader.c b/libgthumb/thumb-loader.c
index fe0a5d5..76882b2 100644
--- a/libgthumb/thumb-loader.c
+++ b/libgthumb/thumb-loader.c
@@ -4,6 +4,7 @@
  *  GThumb
  *
  *  Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+ *  Copyright (C) 2006 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,6 +46,10 @@ #include "glib-utils.h"
 #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)
 
@@ -235,6 +240,7 @@ thumb_loader (const char  *path,
 	      gpointer     data)
 {
 	GdkPixbufAnimation *animation = NULL;
+	g_debug("load thumbnail for %s", path);
 
 #ifdef HAVE_LIBJPEG
 	if (image_is_jpeg (path)) {
@@ -259,6 +265,20 @@ #ifdef HAVE_LIBJPEG
 
 	} else
 #endif
+#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);
