C# WebP image throwing error "An attempt was made to load a program with an incorrect format."

0

I am try to convert jpeg image to webp format. like below in console application

    using (Image image = Image.FromFile("Capture.jpg"))
    {
        Bitmap bitmap = new Bitmap(image);
        WebPFormat.SaveToFile("image.webp", bitmap);
    }

Reference from here

http://webp.codeplex.com/

Below details of error

Error: 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.

ErrorMessage : An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

StatckTrace: at Noesis.Drawing.Imaging.WebP.NoesisWebP.Save(IntPtr& oWebPFileImage, Int32& 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()
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()

c#
webp
asked on Stack Overflow Apr 28, 2017 by Andi AR

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0