Commit 408ce1e7 authored by Nicolas Fella's avatar Nicolas Fella Committed by Bharadwaj Raju
Browse files

Don't attempt to load a nonexistant image when creating thumbnails

When given a path that doesn't exist QImage tries loading that path plus the extensions of all image formats it knows

This  causes unneeded syscalls

We can check once whether the file exists and only attempt to load the image if we know it is there

CCBUG: 458491
parent f1740b68
Pipeline #254201 passed with stage
in 4 minutes and 33 seconds
......@@ -404,6 +404,10 @@ QImage ThumbnailProvider::loadThumbnailFromCache() const
return image;
if (!QFileInfo::exists(mThumbnailPath)) {
return {};
image = QImage(mThumbnailPath);
int largeThumbnailGroup = mThumbnailGroup;
while (image.isNull() && ++largeThumbnailGroup <= ThumbnailGroup::XXLarge) {
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