|
|
@ -684,10 +684,10 @@ public class Game : GameWindow { |
|
|
|
false, 5 * sizeof(float), 3 * sizeof(float)); |
|
|
|
|
|
|
|
// Load photos from a directory.
|
|
|
|
string[] files = Directory.GetFiles(@"c:\users\colin\desktop\photos-test\"); |
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\desktop\photos-test\");
|
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\pictures\photos\2023\07\14\");
|
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\pictures\photos\2023\07\23\");
|
|
|
|
// string[] files = Directory.GetFiles(@"G:\DCIM\100EOSR6\");
|
|
|
|
string[] files = Directory.GetFiles(@"G:\DCIM\100EOSR6\"); |
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\desktop\totte-output\2023\07\31");
|
|
|
|
// string[] files = Directory.GetFiles(@"c:\users\colin\desktop\import");
|
|
|
|
// string[] files = Directory.GetFiles(@"C:\Users\colin\Pictures\photos\2018\06\23");
|
|
|
@ -703,6 +703,21 @@ public class Game : GameWindow { |
|
|
|
} |
|
|
|
|
|
|
|
allPhotos.Sort(ComparePhotosByDate); |
|
|
|
|
|
|
|
// Fix up photos with missing GPS.
|
|
|
|
Rational[]? lastLatitude = null; |
|
|
|
Rational[]? lastLongitude = null; |
|
|
|
foreach (Photo p in allPhotos) { |
|
|
|
if (p.GpsLatitude != null && p.GpsLongitude != null) { |
|
|
|
lastLatitude = p.GpsLatitude; |
|
|
|
lastLongitude = p.GpsLongitude; |
|
|
|
} |
|
|
|
if (p.GpsLatitude == null || p.GpsLongitude == null) { |
|
|
|
Console.WriteLine("fixing GPS for " + p.Filename); |
|
|
|
p.GpsLatitude = lastLatitude; |
|
|
|
p.GpsLongitude = lastLongitude; |
|
|
|
} |
|
|
|
} |
|
|
|
photos = allPhotos; |
|
|
|
|
|
|
|
LoadThumbnailsAsync(); |
|
|
@ -767,7 +782,7 @@ public class Game : GameWindow { |
|
|
|
} |
|
|
|
} |
|
|
|
foreach (Photo p in toLoad) { |
|
|
|
await Task.Run( () => { p.LoadAsync(geometry.PhotoBox.Size); }); |
|
|
|
await Task.Run( () => { p.LoadAsync(p.Size); }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|