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>
This commit is contained in:
Berthold Stoeger 2018-05-15 20:47:35 +02:00 committed by Dirk Hohndel
parent 9a844a075c
commit b28dba6087
5 changed files with 83 additions and 47 deletions

View file

@ -1209,11 +1209,19 @@ QString localFilePath(const QString &originalFilename)
return localFilenameOf.value(originalFilename, originalFilename);
}
// TODO: Apparently Qt has no simple way of listing the supported video
// codecs? Do we have to query them by hand using QMediaPlayer::hasSupport()?
const QStringList videoExtensionsList = {
".avi", ".mp4", ".mpeg", ".mpg", ".wmv"
};
QStringList imageExtensionFilters() {
QStringList filters;
foreach (QString format, QImageReader::supportedImageFormats()) {
filters.append(QString("*.").append(format));
}
foreach (const QString &format, videoExtensionsList)
filters.append("*" + format);
return filters;
}