--- mythplugins-0.18.1/mythgallery/mythgallery/thumbgenerator.cpp	2005-01-31 17:27:43.000000000 +1100
+++ mythplugins-0.18.1.gg/mythgallery/mythgallery/thumbgenerator.cpp	2005-12-31 13:42:25.000000000 +1100
@@ -24,12 +24,16 @@
 #include <qobject.h>
 #include <qfileinfo.h>
 #include <qdir.h>
-
+#include "config.h"
 #include "mythtv/mythcontext.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)
 {
@@ -205,7 +209,7 @@
     }
 
     if (found) {
-        image.load(f->absFilePath());
+	loadFile(image,*f);
         return;
     }
     else {
@@ -272,6 +276,22 @@
   }
   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
   }
 }
--- mythplugins-0.18.1/mythgallery/mythgallery/iconview.cpp	2005-02-25 08:21:35.000000000 +1100
+++ mythplugins-0.18.1.gg/mythgallery/mythgallery/iconview.cpp	2005-12-31 17:00:38.000000000 +1100
@@ -437,6 +437,8 @@
         }
 
 
+        item->pixmap = new QPixmap(td->thumb);
+
         int pos = m_itemList.find(item);
         
         if ((m_topRow*m_nCols <= pos) &&
