配置ImageResizing.Net编程方式 [英] Configuring ImageResizing.Net Programatically

查看:153
本文介绍了配置ImageResizing.Net编程方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ImageResizing.Net 类库内,这需要绕过网络后端的一部分。配置/ App.Config中通过安装在code插件,像这样:

I'm using ImageResizing.Net within a class library as part of a back-end which requires bypassing Web.Config/App.Config by installing plugins in code like so:

ImageResizer.Configuration.Config.Current.Plugins.Install(new ImageResizer.Plugins.SimpleFilters.SimpleFilters());
ImageResizer.Configuration.Config.Current.Plugins.Install(new ImageResizer.Plugins.AdvancedFilters.AdvancedFilters());

我验证过的插件中加载:

I've verified that plugins are loaded within:

ImageResizer.Configuration.Config.Current.Plugins

我收到以下错误,当 imageJob.Build(); 被称为:

无法加载文件或程序集AForge.Imaging,版本= 2.2.5.0,文化=中性公钥= ba8ddea9676ca48b'或它的一个依赖。该系统找不到指定的文件。

Could not load file or assembly 'AForge.Imaging, Version=2.2.5.0, Culture=neutral, PublicKeyToken=ba8ddea9676ca48b' or one of its dependencies. The system cannot find the file specified.

希望这可以通过直接引用库来解决我添加以下using语句到类的使用ImageResizer顶部:

Hoping this could be solved by referencing the libraries directly I've added the following using statements to the top of the class that uses ImageResizer:

using AForge;
using AForge.Imaging;
using AForge.Imaging.Filters;
using AForge.Imaging.ColorReduction;
using AForge.Imaging.ComplexFilters;
using AForge.Imaging.Textures;

我仍然得到同样的错误。我已经验证了我的项目存在AForge引用是正确的版本,并有复制本地设置为真。这些提法都被自动用的NuGet包进行ImageResizing和放大器安装依赖关系的一部分;相关的插件。

Am still getting the same error. I've verified that the AForge references exist in my project, are the correct version and have "Copy Local" set to "True". These references were part of the dependencies that were automatically installed with the Nuget Packages for ImageResizing & the associated plugins.

更新

我已经决定了将图像处理的Web API,因为库没有设计此方案。这是由图书馆在这个S.O.的评论的作者叫出来问题。我将标志着这个作为答案。

I've decided to move the image processing over to a web api since the library was not designed for this scenario. This is called out by the author of the library in the comments of this S.O. question . I will mark this as the answer.

推荐答案

我已经决定了将图像处理的Web API,因为库没有设计此方案。这是由图书馆在这个S.O.的评论的作者叫出来问题

I've decided to move the image processing over to a web api since the library was not designed for this scenario. This is called out by the author of the library in the comments of this S.O. question

这篇关于配置ImageResizing.Net编程方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆