diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-05-15 20:47:35 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-07-08 07:41:15 -0700 |
commit | b28dba6087f0433af8ece176b64fcac54ca370a4 (patch) | |
tree | 58301772930e3f50f64a92da2bbd1ac1cbc84e3e /core/imagedownloader.h | |
parent | 9a844a075c0e964a21a3bfef22324fbcec88544d (diff) | |
download | subsurface-b28dba6087f0433af8ece176b64fcac54ca370a4.tar.gz |
Dive pictures: Recognize video files
When generating thumbnails, test for video files. If it is, use
a dummy-thumbnail. Write only the type (video), but no image to
the thumbnail cache, for forward-compatibility.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/imagedownloader.h')
-rw-r--r-- | core/imagedownloader.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/imagedownloader.h b/core/imagedownloader.h index 13ba80746..d5cb889fe 100644 --- a/core/imagedownloader.h +++ b/core/imagedownloader.h @@ -2,6 +2,7 @@ #ifndef IMAGEDOWNLOADER_H #define IMAGEDOWNLOADER_H +#include "metadata.h" #include <QImage> #include <QFuture> #include <QNetworkReply> @@ -48,14 +49,24 @@ public slots: signals: void thumbnailChanged(QString filename, QImage thumbnail); private: + struct Thumbnail { + QImage img; + mediatype_t type; + }; + Thumbnailer(); + static void addThumbnailToCache(const Thumbnail &thumbnail, const QString &picture_filename); void recalculate(QString filename); void processItem(QString filename, bool tryDownload); + Thumbnail getThumbnailFromCache(const QString &picture_filename); + Thumbnail fetchImage(const QString &filename, const QString &originalFilename, bool tryDownload); + Thumbnail getHashedImage(const QString &filename, bool tryDownload); mutable QMutex lock; QThreadPool pool; QImage failImage; // Shown when image-fetching fails QImage dummyImage; // Shown before thumbnail is fetched + QImage videoImage; // Place holder for videos QMap<QString,QFuture<void>> workingOn; }; |