Ticket #917: fastthumbs.2.patch

File fastthumbs.2.patch, 1.3 KB (added by Grant Gardner <grant@…>, 18 years ago)

Patch against svn trunk

  • mythgallery/mythgallery/thumbgenerator.cpp

     
    2828#include "mythtv/mythcontext.h"
    2929#include "mythtv/util.h"
    3030
     31#include "config.h"
    3132#include "thumbgenerator.h"
    3233#include "constants.h"
    3334#include "galleryutil.h"
    3435
     36#ifdef EXIF_SUPPORT
     37    #include <libexif/exif-data.h>
     38    #include <libexif/exif-entry.h>
     39#endif // EXIF_SUPPORT
     40
     41
    3542ThumbGenerator::ThumbGenerator(QObject *parent, int w, int h)
    3643{
    3744    m_parent = parent;
     
    211218    }
    212219
    213220    if (found) {
    214         image.load(f->absFilePath());
     221        loadFile(image,*f);
    215222        return;
    216223    }
    217224    else {
     
    279286  }
    280287  else
    281288  {
     289         
     290#ifdef EXIF_SUPPORT
     291      //Try to get thumbnail from exif data
     292      //lib exif is simple but not very intuitive when it comes to thumbnails!.
     293      ExifData *ed = exif_data_new_from_file (fi.absFilePath());
     294      if (ed && ed->data)
     295      {
     296             image.loadFromData(ed->data,ed->size);
     297      }
     298      else
     299      {
     300#endif // EXIF_SUPPORT
     301         
    282302      image.load(fi.absFilePath());
     303
     304#ifdef EXIF_SUPPORT
     305      }
     306#endif // EXIF_SUPPORT
    283307  }
    284308}
    285309