diff --git a/src/ImageProcessor/Configuration/NativeBinaryFactory.cs b/src/ImageProcessor/Configuration/NativeBinaryFactory.cs index e210aa0362..16ab92261d 100644 --- a/src/ImageProcessor/Configuration/NativeBinaryFactory.cs +++ b/src/ImageProcessor/Configuration/NativeBinaryFactory.cs @@ -71,6 +71,17 @@ namespace ImageProcessor.Configuration this.Dispose(false); } + /// + /// Gets a value indicating whether the operating environment is 64 bit. + /// + public bool Is64BitEnvironment + { + get + { + return Is64Bit; + } + } + /// /// Registers any embedded native (unmanaged) binaries required by ImageProcessor. /// @@ -90,7 +101,7 @@ namespace ImageProcessor.Configuration b => { IntPtr pointer; - string folder = Is64Bit ? "x64" : "x86"; + string folder = Is64BitEnvironment ? "x64" : "x86"; Assembly assembly = Assembly.GetExecutingAssembly(); string targetBasePath = new Uri(assembly.Location).LocalPath; string targetPath = Path.GetFullPath(Path.Combine(targetBasePath, "..\\" + folder + "\\" + name)); diff --git a/src/ImageProcessorConsole/images/output/rotate.jpg b/src/ImageProcessorConsole/images/output/rotate.jpg index 2d23e99352..5030b00725 100644 --- a/src/ImageProcessorConsole/images/output/rotate.jpg +++ b/src/ImageProcessorConsole/images/output/rotate.jpg @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fbb53b552f559d93ea5d04ac1dd099938405d497362275ff669070e746f89d35 -size 17821 +oid sha256:14b2734f6cb4f808fccf8549da1788450bf9b6e1a95ec3c7c10c96c9e07c2ec3 +size 18422 diff --git a/src/Plugins/ImageProcessor/ImageProcessor.Plugins.WebP/Imaging/Formats/NativeMethods.cs b/src/Plugins/ImageProcessor/ImageProcessor.Plugins.WebP/Imaging/Formats/NativeMethods.cs index 936b582560..a04c449233 100644 --- a/src/Plugins/ImageProcessor/ImageProcessor.Plugins.WebP/Imaging/Formats/NativeMethods.cs +++ b/src/Plugins/ImageProcessor/ImageProcessor.Plugins.WebP/Imaging/Formats/NativeMethods.cs @@ -22,18 +22,12 @@ namespace ImageProcessor.Plugins.WebP.Imaging.Formats /// internal static class NativeMethods { - /// - /// Whether the process is running in 64bit mode. Used for calling the correct method. - /// Clunky I know but I couldn't get dynamic methods to work. - /// - private static readonly bool Is64Bit = Environment.Is64BitProcess; - /// /// Initializes static members of the class. /// static NativeMethods() { - string folder = Is64Bit ? "x64" : "x86"; + string folder = ImageProcessorBootstrapper.Instance.NativeBinaryFactory.Is64BitEnvironment ? "x64" : "x86"; string name = string.Format("ImageProcessor.Plugins.WebP.Resources.Unmanaged.{0}.libwebp.dll", folder); Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);