From b28dba6087f0433af8ece176b64fcac54ca370a4 Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 15 May 2018 20:47:35 +0200 Subject: 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 --- core/imagedownloader.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'core/imagedownloader.h') 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 #include #include @@ -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> workingOn; }; -- cgit v1.2.3-70-g09d2