From b279ce54ef947db7972ab2c9bdee64274af205a6 Mon Sep 17 00:00:00 2001 From: James South Date: Tue, 8 Jul 2014 23:05:35 +0100 Subject: [PATCH] Removing dllimport extensions Former-commit-id: 0c0b015aa6967a6663861f9a3b1621bc7085297c --- src/ImageProcessor/Configuration/NativeBinaryFactory.cs | 2 +- src/ImageProcessor/Configuration/NativeMethods.cs | 4 ++-- src/ImageProcessor/ImageFactory.cs | 6 +++--- src/ImageProcessor/Imaging/Formats/GifFormat.cs | 2 +- src/ImageProcessor/Imaging/Formats/NativeMethods.cs | 8 ++++---- src/ImageProcessorConsole/images/output/120430.gif | 3 +++ src/ImageProcessorConsole/images/output/4.sm.webp | 3 --- src/ImageProcessorConsole/images/output/Tl4Yb.gif | 3 +++ src/ImageProcessorConsole/images/output/nLpfllv.gif | 3 +++ src/ImageProcessorConsole/images/output/test.webp | 3 --- 10 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 src/ImageProcessorConsole/images/output/120430.gif delete mode 100644 src/ImageProcessorConsole/images/output/4.sm.webp create mode 100644 src/ImageProcessorConsole/images/output/Tl4Yb.gif create mode 100644 src/ImageProcessorConsole/images/output/nLpfllv.gif delete mode 100644 src/ImageProcessorConsole/images/output/test.webp diff --git a/src/ImageProcessor/Configuration/NativeBinaryFactory.cs b/src/ImageProcessor/Configuration/NativeBinaryFactory.cs index 5db7a37158..741da61e24 100644 --- a/src/ImageProcessor/Configuration/NativeBinaryFactory.cs +++ b/src/ImageProcessor/Configuration/NativeBinaryFactory.cs @@ -94,7 +94,7 @@ namespace ImageProcessor.Configuration Assembly assembly = Assembly.GetExecutingAssembly(); string targetBasePath = new Uri(assembly.Location).LocalPath; string targetPath = Path.GetFullPath(Path.Combine(targetBasePath, "..\\" + folder + "\\" + name)); - + // Copy the file across if necessary. FileInfo fileInfo = new FileInfo(targetPath); bool rewrite = true; diff --git a/src/ImageProcessor/Configuration/NativeMethods.cs b/src/ImageProcessor/Configuration/NativeMethods.cs index ea2aa1aa91..a20b5a86f4 100644 --- a/src/ImageProcessor/Configuration/NativeMethods.cs +++ b/src/ImageProcessor/Configuration/NativeMethods.cs @@ -27,7 +27,7 @@ namespace ImageProcessor.Configuration /// an executable module. /// /// If the function succeeds, the return value is a handle to the module; otherwise null. - [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)] + [DllImport("kernel32", CharSet = CharSet.Auto, SetLastError = true)] public static extern IntPtr LoadLibrary(string libname); /// @@ -38,7 +38,7 @@ namespace ImageProcessor.Configuration /// A handle to the loaded library module. /// The LoadLibrary, LoadLibraryEx, GetModuleHandle, or GetModuleHandleEx function returns this handle. /// If the function succeeds, the return value is nonzero; otherwise zero. - [DllImport("kernel32.dll", CharSet = CharSet.Auto)] + [DllImport("kernel32", CharSet = CharSet.Auto)] public static extern bool FreeLibrary(IntPtr hModule); } } diff --git a/src/ImageProcessor/ImageFactory.cs b/src/ImageProcessor/ImageFactory.cs index 7e37983c34..29b64cc22c 100644 --- a/src/ImageProcessor/ImageFactory.cs +++ b/src/ImageProcessor/ImageFactory.cs @@ -241,11 +241,11 @@ namespace ImageProcessor if (this.ShouldProcess) { // Set our new image as the memory stream value. - #if !__MonoCS__ +#if !__MonoCS__ Image newImage = Image.FromStream(this.InputStream, true); - #else +#else Image newImage = Image.FromStream(this.InputStream); - #endif +#endif // Dispose and reassign the image. this.Image.Dispose(); diff --git a/src/ImageProcessor/Imaging/Formats/GifFormat.cs b/src/ImageProcessor/Imaging/Formats/GifFormat.cs index dffccb99b9..83904225b8 100644 --- a/src/ImageProcessor/Imaging/Formats/GifFormat.cs +++ b/src/ImageProcessor/Imaging/Formats/GifFormat.cs @@ -86,7 +86,7 @@ namespace ImageProcessor.Imaging.Formats foreach (GifFrame frame in info.GifFrames) { factory.Image = frame.Image; - frame.Image = quantizer.Quantize(processor.Invoke(factory)); + frame.Image = quantizer.Quantize(processor.Invoke(factory)); encoder.AddFrame(frame); } } diff --git a/src/ImageProcessor/Imaging/Formats/NativeMethods.cs b/src/ImageProcessor/Imaging/Formats/NativeMethods.cs index b6cb764505..0c42710b0f 100644 --- a/src/ImageProcessor/Imaging/Formats/NativeMethods.cs +++ b/src/ImageProcessor/Imaging/Formats/NativeMethods.cs @@ -66,7 +66,7 @@ namespace ImageProcessor.Imaging.Formats /// /// 1 if success, otherwise error code returned in the case of (a) formatting error(s). /// - [DllImport("libwebp.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "WebPGetInfo")] + [DllImport("libwebp", CallingConvention = CallingConvention.Cdecl, EntryPoint = "WebPGetInfo")] public static extern int WebPGetInfo(IntPtr data, uint dataSize, out int width, out int height); /// @@ -90,7 +90,7 @@ namespace ImageProcessor.Imaging.Formats /// /// output_buffer if function succeeds; NULL otherwise /// - [DllImport("libwebp.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "WebPDecodeBGRAInto")] + [DllImport("libwebp", CallingConvention = CallingConvention.Cdecl, EntryPoint = "WebPDecodeBGRAInto")] public static extern IntPtr WebPDecodeBGRAInto(IntPtr data, uint dataSize, IntPtr outputBuffer, int outputBufferSize, int outputStride); /// @@ -117,7 +117,7 @@ namespace ImageProcessor.Imaging.Formats /// /// Size of WebP Image /// - [DllImport("libwebp.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "WebPEncodeBGRA")] + [DllImport("libwebp", CallingConvention = CallingConvention.Cdecl, EntryPoint = "WebPEncodeBGRA")] public static extern int WebPEncodeBGRA(IntPtr rgb, int width, int height, int stride, float qualityFactor, out IntPtr output); /// @@ -129,7 +129,7 @@ namespace ImageProcessor.Imaging.Formats /// /// 1 if success, otherwise error code returned in the case of (a) error(s). /// - [DllImport("libwebp.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "WebPFree")] + [DllImport("libwebp", CallingConvention = CallingConvention.Cdecl, EntryPoint = "WebPFree")] public static extern int WebPFree(IntPtr pointer); #endregion } diff --git a/src/ImageProcessorConsole/images/output/120430.gif b/src/ImageProcessorConsole/images/output/120430.gif new file mode 100644 index 0000000000..b8bc8a2da4 --- /dev/null +++ b/src/ImageProcessorConsole/images/output/120430.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:896b26b0129a335a91a5f8820ef9c5bc036dd60fae64690c0f8d281ca97bbc8d +size 8581 diff --git a/src/ImageProcessorConsole/images/output/4.sm.webp b/src/ImageProcessorConsole/images/output/4.sm.webp deleted file mode 100644 index 1cce96a6ca..0000000000 --- a/src/ImageProcessorConsole/images/output/4.sm.webp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bc9ccd29734ed06d2916389cc363955924f4bbb200fea91c113ae2b9334eca1f -size 12162 diff --git a/src/ImageProcessorConsole/images/output/Tl4Yb.gif b/src/ImageProcessorConsole/images/output/Tl4Yb.gif new file mode 100644 index 0000000000..8019bafa38 --- /dev/null +++ b/src/ImageProcessorConsole/images/output/Tl4Yb.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0e47e2ea079ce001c59cab3f7c3801d86b270d752d4399fd35779fb0e5ec9473 +size 12875 diff --git a/src/ImageProcessorConsole/images/output/nLpfllv.gif b/src/ImageProcessorConsole/images/output/nLpfllv.gif new file mode 100644 index 0000000000..fd350d4372 --- /dev/null +++ b/src/ImageProcessorConsole/images/output/nLpfllv.gif @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a06d1e40bfed07eaaf26e416be8abdec8b762e744cde4123e1606e0c89d33cb0 +size 18930 diff --git a/src/ImageProcessorConsole/images/output/test.webp b/src/ImageProcessorConsole/images/output/test.webp deleted file mode 100644 index 4534523db4..0000000000 --- a/src/ImageProcessorConsole/images/output/test.webp +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b41b4fe144f9d3eaee706b516021efc7abc598f17655d9592866963bfa62f3ad -size 5590