Quantcast
Channel: magick Discussions Rss Feed
Viewing all articles
Browse latest Browse all 3693

New Post: Image conversion in web app

$
0
0
Hi All

I'm having trouble getting the following code to run in an ASP.net web application. This is a brand new web application with one aspx file and the code below is in the Page_Load method as a test.
string path = HostingEnvironment.MapPath(@"~\bin\ImageMagick");
MagickNET.Initialize(path);

using (MagickImage image = new MagickImage(@"c:\test\img_01.svg"))
{
image.Write(@"c:\test\img_01_web.jpg");
}
I get an error like this "System.Runtime.InteropServices.SEHException: External component has thrown an exception". The stack trace looks like this
[SEHException (0x80004005): External component has thrown an exception.]
   Magick.Image.{ctor}(Image* ) +0
   ImageMagick.MagickImage..ctor(String fileName) +57
   WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Users\rgo\Documents\Visual Studio 2010\Projects\WebApplication1\WebApplication1\WebForm1.aspx.cs:19
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25
   System.Web.UI.Control.LoadRecursive() +71
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3064
Not sure what the problem is. I guess it's something to do with the location of the dlls but I can't work it out. The dlls have all been copied to the bin folder in a sub folder called "ImageMagick".

The same code in a console application works ok.

Has anyone got any ideas?

Thanks

Russell

Viewing all articles
Browse latest Browse all 3693

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>