diff --git a/core/imagedownloader.cpp b/core/imagedownloader.cpp index cbff1489c..b56dd8b04 100644 --- a/core/imagedownloader.cpp +++ b/core/imagedownloader.cpp @@ -10,6 +10,8 @@ #include #include #include +#include +#include #include @@ -140,8 +142,17 @@ QImage getHashedImage(const QString &file) return res; } -Thumbnailer::Thumbnailer() : failImage(QImage(":filter-close").scaled(maxThumbnailSize(), maxThumbnailSize(), Qt::KeepAspectRatio)), // TODO: Don't misuse filter close icon - dummyImage(QImage(":photo-icon").scaled(maxThumbnailSize(), maxThumbnailSize(), Qt::KeepAspectRatio)) // TODO: Don't misuse photo-icon +static QImage renderIcon(const char *id, int size) +{ + QImage res(size, size, QImage::Format_ARGB32); + QSvgRenderer svg{QString(id)}; + QPainter painter(&res); + svg.render(&painter); + return res; +} + +Thumbnailer::Thumbnailer() : failImage(renderIcon(":filter-close", maxThumbnailSize())), // TODO: Don't misuse filter close icon + dummyImage(renderIcon(":camera-icon", maxThumbnailSize())) { // Currently, we only process one image at a time. Stefan Fuchs reported problems when // calculating multiple thumbnails at once and this hopefully helps. diff --git a/icons/camera.svg b/icons/camera.svg new file mode 100644 index 000000000..31b3766bb --- /dev/null +++ b/icons/camera.svg @@ -0,0 +1,316 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/subsurface.qrc b/subsurface.qrc index c5ba1c7a2..e15ec2077 100644 --- a/subsurface.qrc +++ b/subsurface.qrc @@ -100,5 +100,6 @@ icons/inAndOutPhoto.png icons/language.png icons/defaults.png + icons/camera.svg