From 52dc95c0e7c0edf517ff4651347ea6ceeefabf56 Mon Sep 17 00:00:00 2001 From: ClemensFischer Date: Sun, 23 Feb 2025 22:12:53 +0100 Subject: [PATCH] Update GeoImage.cs --- MapControl/Shared/GeoImage.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MapControl/Shared/GeoImage.cs b/MapControl/Shared/GeoImage.cs index e1390237..36123450 100644 --- a/MapControl/Shared/GeoImage.cs +++ b/MapControl/Shared/GeoImage.cs @@ -132,11 +132,12 @@ namespace MapControl var file = Path.GetFileNameWithoutExtension(sourcePath); var worldFilePath = Path.Combine(dir, file + ext.Remove(2, 1) + "w"); - if (await ImageLoader.LoadImageAsync(sourcePath) is BitmapSource bitmap) + if (File.Exists(worldFilePath)) { - var transform = await ReadWorldFileMatrix(worldFilePath); - - return new GeoBitmap(bitmap, transform, null); + return new GeoBitmap( + (BitmapSource)await ImageLoader.LoadImageAsync(sourcePath), + await ReadWorldFileMatrix(worldFilePath), + null); } }