Commit 7d0ce37f authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Windows Image Thumbnailer] Generate thumbnails for ANI files

Now that we have an ANI image plugin. The thumbnailer already lists ANI files
in its mime type list but that couldn't actually have worked before.

The thumbnailer explicitly calls into Qt's "ico" handler, so it won't
auto-detect ANI files. However, we also don't want to run into its
icon selection algorithm (picking the best fitting and highest color
depth icon there is) because the images we have are just image sequences,
so we'll just run the `QImageReader` directly should we enocunter an
ANI file.

ANI files are a lot less common than ICO, so put it *after* the existing
`loadIcoImage` call which will fail soon enough when it finds it can't
read it using the "ico" plugin, to save a pointless mime type query
every time.
parent 21758ebc
......@@ -18,6 +18,8 @@
#include <QString>
#include <QImage>
#include <QImageReader>
#include <QMimeDatabase>
extern "C"
......@@ -29,7 +31,16 @@ extern "C"
bool WindowsImageCreator::create(const QString &path, int width, int height, QImage &img)
if (IcoUtils::loadIcoImage(path, img, width, height)) {
return true;
// Maybe it's an animated cursor
if (QMimeDatabase().mimeTypeForFile(path).name() == QLatin1String("application/x-navi-animation")) {
QImageReader reader(path, "ani");
return IcoUtils::loadIcoImage(path, img, width, height);
return false;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment