title: C# WebP image throwing error "An attempt was made to load a program with an incorrect format."
body: <p>I am try to convert jpeg image to webp format. like below in console application</p>
  <pre><code>    using (Image image = Image.FromFile(&quot;Capture.jpg&quot;))
      {
          Bitmap bitmap = new Bitmap(image);
          WebPFormat.SaveToFile(&quot;image.webp&quot;, bitmap);
      }
  </code></pre>
  <p>Reference from here</p>
  <p><a href="http://webp.codeplex.com/" rel="nofollow noreferrer">http://webp.codeplex.com/</a></p>
  <p>Below details of error</p>
  <blockquote>
  <p><strong>Error:</strong> An unhandled exception of type 'System.BadImageFormatException' occurred in
  Noesis.Drawing.Imaging.WebP.dll
  Additional information: An attempt was made to load a program with an incorrect format.</p>
  <p><strong>ErrorMessage</strong> : An attempt was made to load a program with an incorrect
  format. (Exception from HRESULT: 0x8007000B)</p>
  <p><strong>StatckTrace:</strong>    at Noesis.Drawing.Imaging.WebP.NoesisWebP.Save(IntPtr&amp; oWebPFileImage,
  Int32&amp; oWebPFileImageSize, IntPtr iBitmap, Int32 iWidth, Int32
  iHeight, Int32 iQuality)    at
  Noesis.Drawing.Imaging.WebP.WebPFormat.Save(Int32 iQuality, Bitmap
  iImage)    at Noesis.Drawing.Imaging.WebP.WebPFormat.SaveToFile(String
  iFilename, Int32 iQuality, Bitmap iImage)    at
  WebP.Program.Main(String[] args) in
  c:-----\Program.cs:line 17    at
  System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[]
  args)    at System.AppDomain.ExecuteAssembly(String assemblyFile,
  Evidence assemblySecurity, String[] args)    at
  Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()<br />
  at System.Threading.ExecutionContext.RunInternal(ExecutionContext
  executionContext, ContextCallback callback, Object state, Boolean
  preserveSyncCtx)    at
  System.Threading.ExecutionContext.Run(ExecutionContext
  executionContext, ContextCallback callback, Object state, Boolean
  preserveSyncCtx)    at
  System.Threading.ExecutionContext.Run(ExecutionContext
  executionContext, ContextCallback callback, Object state)    at
  System.Threading.ThreadHelper.ThreadStart()</p>
  </blockquote>