ExportPhotos: load images async'ly

This commit is contained in:
Colin McMillen 2023-07-28 16:32:54 -04:00
parent cf354937e7
commit 831637338c

View File

@ -233,7 +233,7 @@ public class Photo {
Console.WriteLine("saving " + filename);
// FIXME: update JPEG metadata.
// FIXME: warn if the file already exists?
using (Image<Rgba32> image = Image.Load<Rgba32>(Filename)) {
using (Image<Rgba32> image = await Image.LoadAsync<Rgba32>(Filename)) {
// Util.RotateImageFromExif(image, Orientation);
await image.SaveAsync(filename, encoder);
}
@ -804,8 +804,8 @@ public class Game : GameWindow {
// Load photos from a directory.
// 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(@"G:\DCIM\100EOSR6\");
string[] files = Directory.GetFiles(@"c:\users\colin\pictures\photos\2023\07\14\");
// string[] files = Directory.GetFiles(@"G:\DCIM\100EOSR6\");
// string[] files = Directory.GetFiles(@"C:\Users\colin\Pictures\photos\2018\06\23");
// string[] files = Directory.GetFiles(@"C:\Users\colin\Desktop\Germany all\104D7000");
// string[] files = Directory.GetFiles(@"C:\Users\colin\Desktop\many-birds\");