From 95882f3135a8c7042ff6d67801c9ac513d512d17 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Fri, 25 Aug 2023 01:04:47 -0400 Subject: [PATCH] skip metadata for texture loading --- Photo.cs | 7 +++++-- Program.cs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Photo.cs b/Photo.cs index 4b23a4d..f2710b1 100644 --- a/Photo.cs +++ b/Photo.cs @@ -53,8 +53,10 @@ public class Photo { // a texture for it until that's already happened. LastTouch = touchCounter++; // TODO: if we zoom in to more than the display size, actually load the whole image? + // TODO: now cropping is fucky. DecoderOptions options = new DecoderOptions { - TargetSize = new Size(size.X, size.Y) + TargetSize = new Size(size.X, size.Y), + SkipMetadata = true }; Image tmp = await Image.LoadAsync(options, Filename); Util.RotateImageFromExif(tmp, Orientation); @@ -63,7 +65,8 @@ public class Photo { public async void LoadThumbnailAsync(Vector2i size) { DecoderOptions options = new DecoderOptions { - TargetSize = new Size(size.X, size.Y) + TargetSize = new Size(size.X, size.Y), + SkipMetadata = true }; Image tmp = await Image.LoadAsync(options, Filename); Util.RotateImageFromExif(tmp, Orientation); diff --git a/Program.cs b/Program.cs index 8b3da33..84e380e 100644 --- a/Program.cs +++ b/Program.cs @@ -642,8 +642,8 @@ public class Game : GameWindow { // 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"); - string[] files = Directory.GetFiles(@"C:\Users\colin\Desktop\Germany all\104D7000"); - // string[] files = Directory.GetFiles(@"C:\Users\colin\Desktop\many-birds\"); + // string[] files = Directory.GetFiles(@"C:\Users\colin\Desktop\Germany all\104D7000"); + string[] files = Directory.GetFiles(@"C:\Users\colin\Desktop\many-birds\"); for (int i = 0; i < files.Count(); i++) { string file = files[i];