Index: mythgallery/mythgallery/thumbgenerator.cpp
===================================================================
--- mythgallery/mythgallery/thumbgenerator.cpp	(revision 8482)
+++ mythgallery/mythgallery/thumbgenerator.cpp	(working copy)
@@ -28,10 +28,17 @@
 #include "mythtv/mythcontext.h"
 #include "mythtv/util.h"
 
+#include "config.h"
 #include "thumbgenerator.h"
 #include "constants.h"
 #include "galleryutil.h"
 
+#ifdef EXIF_SUPPORT
+    #include <libexif/exif-data.h>
+    #include <libexif/exif-entry.h>
+#endif // EXIF_SUPPORT
+
+
 ThumbGenerator::ThumbGenerator(QObject *parent, int w, int h)
 {
     m_parent = parent;
@@ -211,7 +218,7 @@
     }
 
     if (found) {
-        image.load(f->absFilePath());
+        loadFile(image,*f);
         return;
     }
     else {
@@ -279,7 +286,24 @@
   }
   else
   {
+	  
+#ifdef EXIF_SUPPORT
+      //Try to get thumbnail from exif data
+      //lib exif is simple but not very intuitive when it comes to thumbnails!.
+      ExifData *ed = exif_data_new_from_file (fi.absFilePath());
+      if (ed && ed->data) 
+      {
+	     image.loadFromData(ed->data,ed->size);
+      }
+      else
+      {
+#endif // EXIF_SUPPORT
+	  
       image.load(fi.absFilePath());
+
+#ifdef EXIF_SUPPORT
+      }
+#endif // EXIF_SUPPORT
   }
 }
 
