-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the plugin and libwebp versions to the save UI
This makes it easier for users to determine what version of the plugin they have installed. The plugin version is also listed as part of the Paint.NET Diagnostics (in Settings > Diagnostics), but that is harder to find and use.
- Loading branch information
1 parent
d76bd54
commit 0c9397d
Showing
8 changed files
with
104 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ ifd | |
interop | ||
jpeg | ||
kvp | ||
libwebp | ||
metadata | ||
nq | ||
num | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
//////////////////////////////////////////////////////////////////////// | ||
// | ||
// This file is part of pdn-webp, a FileType plugin for Paint.NET | ||
// that loads and saves WebP images. | ||
// | ||
// Copyright (c) 2011-2023 Nicholas Hayes | ||
// | ||
// This file is licensed under the MIT License. | ||
// See LICENSE.txt for complete licensing and attribution information. | ||
// | ||
//////////////////////////////////////////////////////////////////////// | ||
|
||
using System; | ||
using System.Diagnostics; | ||
|
||
namespace WebPFileType | ||
{ | ||
internal static class VersionInfo | ||
{ | ||
private static readonly Lazy<string> libwebpVersion = new(GetLibWebPVersion); | ||
private static readonly Lazy<string> pluginVersion = new(GetPluginVersion); | ||
|
||
[DebuggerBrowsable(DebuggerBrowsableState.Never)] | ||
public static string LibWebPVersion => libwebpVersion.Value; | ||
|
||
[DebuggerBrowsable(DebuggerBrowsableState.Never)] | ||
public static string PluginVersion => pluginVersion.Value; | ||
|
||
private static string GetLibWebPVersion() | ||
{ | ||
int libwebpVersion = WebPNative.GetLibWebPVersion(); | ||
|
||
int major = (libwebpVersion >> 16) & 0xff; | ||
int minor = (libwebpVersion >> 8) & 0xff; | ||
int revision = libwebpVersion & 0xff; | ||
|
||
return $"{major}.{minor}.{revision}"; | ||
} | ||
|
||
private static string GetPluginVersion() | ||
=> typeof(VersionInfo).Assembly.GetName().Version.ToString(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters