Skip to content

Commit

Permalink
version 1.34
Browse files Browse the repository at this point in the history
  • Loading branch information
XyLe-GBP committed Jan 5, 2023
1 parent 34ea85c commit 0be1ab2
Show file tree
Hide file tree
Showing 21 changed files with 1,475 additions and 1,154 deletions.
3 changes: 3 additions & 0 deletions ApplicationUpdater/ApplicationUpdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ int main()
, sfname = common->TWStringToString(fname)
, sext = common->TWStringToString(ext);

HWND handle = FindWindow(_T("waifu2x-nvger"), NULL);
PostMessage(handle, WM_CLOSE, 0, 0);

if (PathFileExists(common->StringToWString(sdrive + sdir + "updater.dat").c_str())) {
cout << "Updater - Application Update Utility v1.2" << endl;
cout << "Copyright (C) 2022 XyLe. All Rights Reserved.\n" << endl;
Expand Down
29 changes: 29 additions & 0 deletions Localization/Strings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions Localization/Strings.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,9 @@ Do you want to update it?</value>
<data name="FilterVideo" xml:space="preserve">
<value>Audio Video Interleave (*.avi)|*.avi;|MPEG-4 (*.mp4)|*.mp4;|Animation GIF (*.gif)|*.gif;|QuickTime Video (*.mov)|*.mov;|Google WebM (*.webm)|*.webm;|Matroska Video (*.mkv)|*.mkv;|Windows Media Video (*.wmv)|*.wmv;|All Supported Files|*.avi;*.mp4;*.gif;*.mov;*.webm;*.mkv;*.wmv</value>
</data>
<data name="GPUInfomationFailedCaption" xml:space="preserve">
<value>Failed to retrieve information.</value>
</data>
<data name="IMGS" xml:space="preserve">
<value>Image(s)</value>
</data>
Expand Down Expand Up @@ -308,6 +311,14 @@ Do you wish to continue?</value>
<data name="MSGWarning" xml:space="preserve">
<value>Warning</value>
</data>
<data name="NotInstalledGSCaption" xml:space="preserve">
<value>The opened file is a PostScript image, but Ghostscript is
not installed on the computer and the file cannot be opened.</value>
</data>
<data name="NotInstalledGSCaption2" xml:space="preserve">
<value>The opened file contains a PostScript image, but I cannot open the file
because I do not have Ghostscript installed on my computer.</value>
</data>
<data name="NotNetworkConnectionCaption" xml:space="preserve">
<value>The computer is not connected to the Internet.</value>
</data>
Expand Down
11 changes: 11 additions & 0 deletions Localization/Strings.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ Nose: アップスケール倍率は'2倍'のみ指定できます。ノイズ
<data name="FmtErrorCaption" xml:space="preserve">
<value>サポートされていないファイル形式です。</value>
</data>
<data name="GPUInfomationFailedCaption" xml:space="preserve">
<value>情報の取得に失敗しました。</value>
</data>
<data name="ImgOnlyMultipleCaption" xml:space="preserve">
<value>画像以外は複数のファイルを読み込むことはできません。</value>
</data>
Expand Down Expand Up @@ -325,6 +328,14 @@ Nose: アップスケール倍率は'2倍'のみ指定できます。ノイズ
<data name="MultipleImageCaption" xml:space="preserve">
<value>複数の画像ファイル</value>
</data>
<data name="NotInstalledGSCaption" xml:space="preserve">
<value>開かれたファイルはPostScript画像ですが
コンピュータにGhostscriptがインストールされていないため、ファイルが開けません。</value>
</data>
<data name="NotInstalledGSCaption2" xml:space="preserve">
<value>開かれたファイルにPostScript画像が含まれていますが
コンピュータにGhostscriptがインストールされていないため、ファイルが開けません。</value>
</data>
<data name="NotNetworkConnectionCaption" xml:space="preserve">
<value>コンピューターがインターネットに接続されていません。</value>
</data>
Expand Down
11 changes: 11 additions & 0 deletions Localization/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ Do you want to update it?</value>
<data name="FmtErrorCaption" xml:space="preserve">
<value>This is an unsupported file format.</value>
</data>
<data name="GPUInfomationFailedCaption" xml:space="preserve">
<value>Failed to retrieve information.</value>
</data>
<data name="ImgOnlyMultipleCaption" xml:space="preserve">
<value>It is not possible to load multiple files except for images.</value>
</data>
Expand Down Expand Up @@ -326,6 +329,14 @@ Do you wish to continue?</value>
<data name="MultipleImageCaption" xml:space="preserve">
<value>Multiple image files</value>
</data>
<data name="NotInstalledGSCaption" xml:space="preserve">
<value>The opened file is a PostScript image, but Ghostscript is
not installed on the computer and the file cannot be opened.</value>
</data>
<data name="NotInstalledGSCaption2" xml:space="preserve">
<value>The opened file contains a PostScript image, but I cannot open the file
because I do not have Ghostscript installed on my computer.</value>
</data>
<data name="NotNetworkConnectionCaption" xml:space="preserve">
<value>The computer is not connected to the Internet.</value>
</data>
Expand Down
10 changes: 10 additions & 0 deletions Localization/Strings.zh.resx
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,9 @@ CRF级别 "的值必须至少是一个字符。</value>
<data name="FmtErrorCaption" xml:space="preserve">
<value>这是一种不支持的文件格式。</value>
</data>
<data name="GPUInfomationFailedCaption" xml:space="preserve">
<value>检索信息失败。</value>
</data>
<data name="ImgOnlyMultipleCaption" xml:space="preserve">
<value>不可能加载一个以上的文件,图像除外。</value>
</data>
Expand Down Expand Up @@ -325,6 +328,13 @@ CRF级别 "的值必须至少是一个字符。</value>
<data name="MultipleImageCaption" xml:space="preserve">
<value>多个图像文件</value>
</data>
<data name="NotInstalledGSCaption" xml:space="preserve">
<value>打开的文件是一个PostScript图像,但
由于计算机上没有安装Ghostscript,所以无法打开该文件。</value>
</data>
<data name="NotInstalledGSCaption2" xml:space="preserve">
<value>打开的文件包含一个PostScript图像,但由于计算机上没有安装Ghostscript,所以无法打开该文件。</value>
</data>
<data name="NotNetworkConnectionCaption" xml:space="preserve">
<value>你的电脑没有连接到互联网。</value>
</data>
Expand Down
Binary file removed Properties/WAIFU2X_MAINICON.ico
Binary file not shown.
Binary file modified Properties/w2xr_multi.ico
Binary file not shown.
Binary file modified Properties/waifu2x-splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion VERSIONINFO
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version:1.33.2220.1225
version:1.34.2320.105
122 changes: 98 additions & 24 deletions src/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,27 @@ class Common

#endregion

/// <summary>
/// Ghostscriptがインストールされているかどうかを調べる
/// </summary>
/// <returns>true: インストールされている</returns>
public static bool CheckGhostscript()
{
string[] list = SystemInfo.GetUninstallList();
foreach (string app in list)
{
if (app.Contains("Ghostscript"))
{
return true;
}
else
{
continue;
}
}
return false;
}

public static string CheckVideoAudioCodec(string VideoPath)
{
ProcessStartInfo pi = new();
Expand Down Expand Up @@ -1255,6 +1276,31 @@ public static List<string> GetGraphicsCardsInformation()
}
else { return null; }
}

public static string[] GetUninstallList()
{
List<string> ret = new();

string uninstall_path = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall";
Microsoft.Win32.RegistryKey uninstall = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(uninstall_path, false);
if (uninstall != null)
{
foreach (string subKey in uninstall.GetSubKeyNames())
{
string appName = null;
Microsoft.Win32.RegistryKey appkey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(uninstall_path + "\\" + subKey, false);

if (appkey.GetValue("DisplayName") != null)
appName = appkey.GetValue("DisplayName").ToString();
else
appName = subKey;

ret.Add(appName);
}
}

return ret.ToArray();
}
}

public class VRAMInfo
Expand All @@ -1279,41 +1325,52 @@ public VRAMInfo GetdGPUInfo()
int count = 0;
foreach (string kn in rKey.GetSubKeyNames())
{
if (kn.Contains("0"))
if (kn.Contains('0'))
{
RegistryKey vk = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\" + kn);
foreach (string skn in vk.GetValueNames())
foreach (string vs in vk.GetSubKeyNames())
{
if (skn.Contains("DriverDesc"))
if (vs.Contains("VolatileSettings"))
{
nm[count] = (string)vk.GetValue("DriverDesc") + " - " + (string)vk.GetValue("DriverVersion");
}
else if (skn.Contains("HardwareInformation.qwMemorySize"))
{
rm[count] = (long)vk.GetValue("HardwareInformation.qwMemorySize") / 1048576;

}
else if (skn.Contains("HardwareInformation.MemorySize"))
{
if (rm[count] == 0)
foreach (string skn in vk.GetValueNames())
{
try
if (skn.Contains("DriverDesc"))
{
rm[count] = (long)vk.GetValue("HardwareInformation.MemorySize");
nm[count] = (string)vk.GetValue("DriverDesc") + " - " + (string)vk.GetValue("DriverVersion");
}
catch (Exception ex)
else if (skn.Contains("HardwareInformation.qwMemorySize"))
{
rm[count] = (long)vk.GetValue("HardwareInformation.qwMemorySize") / 1048576;

}
else if (skn.Contains("HardwareInformation.MemorySize"))
{
if (rm[count] == 0)
{
try
{
rm[count] = (long)vk.GetValue("HardwareInformation.MemorySize");
}
catch (Exception ex)
{
rm[count] = 0;
}
}
}
else
{
rm[count] = 0;
}
}
vk.Close();
count++;
continue;
}
else
{
continue;
}
}
vk.Close();
count++;
continue;

}
else
{
Expand All @@ -1325,22 +1382,39 @@ public VRAMInfo GetdGPUInfo()
return vi;
}

public int GetCount()
/// <summary>
/// グラフィックボードの数を取得
/// </summary>
/// <returns></returns>
public static int GetCount()
{
int count = 0;
RegistryKey rKey = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}");
foreach (string kn in rKey.GetSubKeyNames())
{
if (kn.Contains("0"))
if (kn.Contains('0'))
{
count++;
continue;
RegistryKey vk = Registry.LocalMachine.OpenSubKey(@"SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\" + kn);
foreach (string vs in vk.GetSubKeyNames())
{
if (vs.Contains("VolatileSettings"))
{
count++;
continue;
}
else
{
continue;
}
}
vk.Close();
}
else
{
continue;
}
}
rKey.Close();
return count;
}
}
Expand Down
7 changes: 4 additions & 3 deletions src/Forms/FormAbout.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions src/Forms/FormImageLoading.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ImageMagick;
using Microsoft.VisualBasic;
using NVGE.Localization;
using System.Drawing;
using System.Threading.Tasks;
using System.Windows.Forms;
Expand Down Expand Up @@ -36,7 +36,7 @@ private async void FormImageLoading_Load(object sender, System.EventArgs e)
{
progressBar1.Style = ProgressBarStyle.Marquee;
progressBar1.MarqueeAnimationSpeed = 50;
await Task.Run(() => Main());
await Task.Run(Main);
Close();
}

Expand All @@ -50,8 +50,10 @@ private void Main()
else
{
using var image = new MagickImage(inpath);
image.Depth = 16;
image.Write(outpath, MagickFormat.Png32);
}
}

}
}
Loading

0 comments on commit 0be1ab2

Please sign in to comment.