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 cafd5f805f..9e982a5ad4 100644 Binary files a/src/ImageProcessorConsole/images/output/rotate.jpg and b/src/ImageProcessorConsole/images/output/rotate.jpg differ 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);