Skip to content

Commit

Permalink
Make preview job handle failing to load images
Browse files Browse the repository at this point in the history
  • Loading branch information
zzag committed Apr 21, 2022
1 parent 96750f2 commit 5dd8e6f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/declarative/dynamicwallpaperpreviewjob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,14 @@ static DynamicWallpaperImageAsyncResult makePreview(const QString &fileName, con
}

const QImage darkImage = reader.image(darkIndex);
if (darkImage.isNull())
return DynamicWallpaperImageAsyncResult(reader.errorString());

const QImage lightImage = reader.image(lightIndex);
preview = blend(darkImage, lightImage, 0.5);
if (lightImage.isNull())
return DynamicWallpaperImageAsyncResult(reader.errorString());

preview = blend(darkImage, lightImage, 0.5);
DynamicWallpaperPreviewCache::store(preview, fileName);
}

Expand Down

0 comments on commit 5dd8e6f

Please sign in to comment.