无法让 ImageMagick .Net 与 Asp.Net 4.0 一起使用
我已经从 Codeplex 下载了 ImageMagick.Net 源代码,并使用 Visual Studio 2010 进行编译。它可以构建,但是当我使用生成的 ImageMagickNET.dll 时在我的 Asp.Net 4.0 应用程序中,我收到以下错误。
External component has thrown an exception.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.SEHException: External component has thrown an exception.
Source Error:
Line 1049: void Image::Read(System::String^ imageSpec)
Line 1050: {
Line 1051: image->read(Marshaller::SystemStringToStdString(imageSpec));
Line 1052: }
Line 1053:
Source File: d:\dev\projects\imagemagick-63489\imagemagick.net\imagemagicknet\image.cpp Line: 1051
Stack Trace:
[SEHException (0x80004005): External component has thrown an exception.]
Magick.Image.read(Image* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* ) +0
ImageMagickNET.Image.Read(String imageSpec_) in d:\dev\projects\imagemagick-63489\imagemagick.net\imagemagicknet\image.cpp:1051
ImageMagickTest._Default.Page_Load(Object sender, EventArgs e) in D:\Sites\ImageMagickTest\ImageMagickTest\Default.aspx.cs:22
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
有人通过从源代码编译来使 ImagMagick.Net 工作吗?
I have downloaded the ImageMagick.Net source code from Codeplex and compiled using Visual Studio 2010. It builds but when I use the generated ImageMagickNET.dll into my Asp.Net 4.0 application I get the following error.
External component has thrown an exception.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.SEHException: External component has thrown an exception.
Source Error:
Line 1049: void Image::Read(System::String^ imageSpec)
Line 1050: {
Line 1051: image->read(Marshaller::SystemStringToStdString(imageSpec));
Line 1052: }
Line 1053:
Source File: d:\dev\projects\imagemagick-63489\imagemagick.net\imagemagicknet\image.cpp Line: 1051
Stack Trace:
[SEHException (0x80004005): External component has thrown an exception.]
Magick.Image.read(Image* , basic_string<char\,std::char_traits<char>\,std::allocator<char> >* ) +0
ImageMagickNET.Image.Read(String imageSpec_) in d:\dev\projects\imagemagick-63489\imagemagick.net\imagemagicknet\image.cpp:1051
ImageMagickTest._Default.Page_Load(Object sender, EventArgs e) in D:\Sites\ImageMagickTest\ImageMagickTest\Default.aspx.cs:22
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +91
System.Web.UI.Control.LoadRecursive() +74
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207
Has anyone got ImagMagick.Net working by compiling from the source code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这是一个有点老的问题,但这看起来与我看到的不匹配的 ImageMagick 版本的问题类似。
如果您使用来自其来源的 ImageMagickNET,则需要确保已安装 ImageMagick 6.5.3-10。这可能意味着从源代码构建该版本,因为我认为二进制文件在任何地方都不可用(至少对于 Windows)。
如果您使用新的 ImageMagick 版本的源代码更新了 ImageMagickNET 项目,则可以将其与较新安装的 ImageMagick 版本一起使用。但是,在 Windows 上使用 ImageMagick 6.6.6-10 尝试此方法时,我遇到了几次崩溃。可能是底层库发生了太多变化,ImageMagickNET 包装器无法与这个最新版本正常工作。
I know this is a bit of an old question, but this looks similar to an issue with unmatched ImageMagick versions that I was seeing.
If you are using the ImageMagickNET from their sources, you need to make sure you have ImageMagick 6.5.3-10 installed. This probably means building that release from sources, as I don't think the binaries are available anywhere (at least for Windows).
If you updated the ImageMagickNET project with sources from a new ImageMagick release, then you can use it with your newer installed version of ImageMagick. However, I experience several crashes when trying this approach with ImageMagick 6.6.6-10 on Windows. It may be that too much has changed in the underlying library for the ImageMagickNET wrapper to work correctly with this more recent version.