ColorfulSoft / DeOldify.NET

C# implementation of Jason Antic's DeOldify
Apache License 2.0
299 stars 57 forks source link

Some issues when compiling under Visual Studio Community Edition 2022 (latest version) #28

Open ukaprch opened 1 year ago

ukaprch commented 1 year ago

First of all, many thanks for publishing this on GitHub. I am running Windows 10 64 bit OS and your Stable.Model.Simd.Float 64 bit version of the product version 2.1 I notice a bit of a difference from version 1.0 with regard to more realistic color differentiation. With the SIMD it is crazy fast compared to without.

  1. For users of Visual Studio you will need to go into properties for each resource and mark them as imbedded resources for manifest to work. Having done that I needed (for all resources) to provide the following for each call to GetManifestResourceStream("Info.png") to this: GetManifestResourceStream("DeOldify.Resources.Info.png")

  2. If you run the app, then close the app without doing anything I got a null exception error on the following in Ui.cs: try { if (this.ColorizationThread != null) <<<====needed to add this check for null exception. { this.ColorizationThread.Abort(); } } catch { }

  3. In Ui.cs private void StartHandler(object sender, EventArgs e) I needed to do the following because of a cross thread exception error: this.BlurryOutput = Blurify(this.NormalOutput); this.OutputImage.Image = this.NormalOutput; this.Invoke((Action)delegate <<<===added this check to avoid cross thread exception { this.OutputImage.Enabled = true; this.InputImage.Enabled = true; this.StartButton.Text = "Done!"; this.StartButton.Enabled = false; this.StartButton.ShowProgress = false; this.StartButton.Click -= this.StopHandler; this.StartButton.Click += this.StartHandler; });

  4. Nice to have: you can add more extensions i.e. .tif (I see you only ref .tiff) and I'm sure other variants of well know extensions when you select the open image dialog. This is just a minor thing.