Remove Task.Run in ImageLoader.LoadImageAsync

This commit is contained in:
ClemensFischer 2025-02-23 18:38:34 +01:00
parent edcdeb09c1
commit f03a627a86
3 changed files with 10 additions and 16 deletions

View file

@ -132,12 +132,11 @@ namespace MapControl
var file = Path.GetFileNameWithoutExtension(sourcePath);
var worldFilePath = Path.Combine(dir, file + ext.Remove(2, 1) + "w");
if (File.Exists(worldFilePath))
if (await ImageLoader.LoadImageAsync(sourcePath) is BitmapSource bitmap)
{
return new GeoBitmap(
(BitmapSource)await ImageLoader.LoadImageAsync(sourcePath),
await ReadWorldFileMatrix(worldFilePath),
null);
var transform = await ReadWorldFileMatrix(worldFilePath);
return new GeoBitmap(bitmap, transform, null);
}
}