mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix file lock during file stream
This commit is contained in:
parent
80c283a370
commit
5c16b86edf
1 changed files with 9 additions and 6 deletions
|
|
@ -48,12 +48,15 @@ public static class WallpaperPathRetrieval
|
|||
return cachedWallpaper;
|
||||
}
|
||||
}
|
||||
|
||||
using var fileStream = File.OpenRead(wallpaperPath);
|
||||
var decoder = BitmapDecoder.Create(fileStream, BitmapCreateOptions.DelayCreation, BitmapCacheOption.None);
|
||||
var frame = decoder.Frames[0];
|
||||
var originalWidth = frame.PixelWidth;
|
||||
var originalHeight = frame.PixelHeight;
|
||||
|
||||
int originalWidth, originalHeight;
|
||||
using (var fileStream = File.OpenRead(wallpaperPath))
|
||||
{
|
||||
var decoder = BitmapDecoder.Create(fileStream, BitmapCreateOptions.DelayCreation, BitmapCacheOption.None);
|
||||
var frame = decoder.Frames[0];
|
||||
originalWidth = frame.PixelWidth;
|
||||
originalHeight = frame.PixelHeight;
|
||||
}
|
||||
|
||||
if (originalWidth == 0 || originalHeight == 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue