Ticket #917: fastthumbs.patch

File fastthumbs.patch, 1.6 KB (added by Grant Gardner <grant@…>, 13 years ago)
  • mythgallery/mythgallery/thumbgenerator.cpp

    old new  
    2424#include <qobject.h>
    2525#include <qfileinfo.h>
    2626#include <qdir.h>
    27 
     27#include "config.h"
    2828#include "mythtv/mythcontext.h"
    2929
    3030#include "thumbgenerator.h"
    3131#include "constants.h"
    3232#include "galleryutil.h"
     33#ifdef EXIF_SUPPORT
     34    #include <libexif/exif-data.h>
     35    #include <libexif/exif-entry.h>
     36#endif // EXIF_SUPPORT
    3337
    3438ThumbGenerator::ThumbGenerator(QObject *parent, int w, int h)
    3539{
     
    205209    }
    206210
    207211    if (found) {
    208         image.load(f->absFilePath());
     212        loadFile(image,*f);
    209213        return;
    210214    }
    211215    else {
     
    272276  }
    273277  else
    274278  {
     279#ifdef EXIF_SUPPORT
     280      //Try to get thumbnail from exif data
     281      //lib exif is simple but not very intuitive when it comes to thumbnails!.
     282      ExifData *ed = exif_data_new_from_file (fi.absFilePath());
     283      if (ed && ed->data)
     284      {
     285             image.loadFromData(ed->data,ed->size);
     286      }
     287      else
     288      {
     289#endif // EXIF_SUPPORT
     290         
    275291      image.load(fi.absFilePath());
     292
     293#ifdef EXIF_SUPPORT
     294      }
     295#endif // EXIF_SUPPORT
    276296  }
    277297}
  • mythgallery/mythgallery/iconview.cpp

    old new  
    437437        }
    438438
    439439
     440        item->pixmap = new QPixmap(td->thumb);
     441
    440442        int pos = m_itemList.find(item);
    441443       
    442444        if ((m_topRow*m_nCols <= pos) &&