【发布时间】:2016-03-27 00:16:21
【问题描述】:
在 Umbraco ImageProcessor notcropper 方面存在与许多其他问题相同的问题。我目前使用的是 7.4 版,但 7.3 版也根本不裁剪图像。
我正在使用 Azure Blob 存储,CDN 已遵循配置设置。
完整图像正在通过 Umbraco Back Office 上传到 Azure 存储,但尝试了各种格式的 URL 请求来拉取和裁剪图像,但无论是 JPG 还是 PNG 文件,都没有成功。完全没有裁剪,总是返回完整的图像。
使用 fiddler,我可以看到请求将转到 Azure Blob 来检索图像,但无论裁剪大小如何,总是返回完整的图像大小。
包配置 ...
<package id="ImageProcessor" version="2.3.1.0" targetFramework="net452" />
<package id="ImageProcessor.Web" version="4.4.1.0" targetFramework="net452" />
<package id="ImageProcessor.Web.Config" version="2.2.4.0" targetFramework="net452" />
<package id="ImageProcessor.Web.Plugins.AzureBlobCache" version="1.0.5.0" targetFramework="net452" />
<package id="UmbracoFileSystemProviders.Azure" version="0.5.0-beta" targetFramework="net452" />
网页配置 ...
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
<remove name="UrlRewriteModule" />
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
<remove name="UmbracoModule" />
<add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" />
<remove name="ImageProcessorModule" />
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web" />
<remove name="ScriptModule" />
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<remove name="ClientDependencyModule" />
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
<!-- Needed for login/membership to work on homepage (as per http://stackoverflow.com/questions/218057/httpcontext-current-session-is-null-when-routing-requests) -->
<remove name="FormsAuthentication" />
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" />
</modules>
<httpModules>
<add name="UrlRewriteModule" type="UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter" />
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add name="UmbracoModule" type="Umbraco.Web.UmbracoModule,umbraco" />
<add name="ImageProcessorModule" type="ImageProcessor.Web.HttpModules.ImageProcessingModule, ImageProcessor.Web" />
<add name="ClientDependencyModule" type="ClientDependency.Core.Module.ClientDependencyModule, ClientDependency.Core" />
</httpModules>
【问题讨论】:
-
首先要检查的是日志文件中是否记录了任何错误?
-
感谢您的回复。我应该在我的问题中指出,因为我检查了日志文件中的错误。没有错误。是否有推荐的方法来逐步执行图像处理器逻辑或其他方法来确定它是否正在运行。
-
这里有一个非常长的线程:our.umbraco.org/projects/backoffice-extensions/… 希望这可能会有所帮助?
-
感谢 Tim 的链接,但根据该线程上的 cmets,我已经正确安装并设置了我的配置,但仍然没有发生裁剪。图像在 Blob 存储中保存和流动都非常好,缓存到 CDN 也运行良好。安全配置正在工作,因为我最初无法检索,直到我添加了正确的白名单。我什至不知道我是否正在通过图像处理器模块/处理程序运行。 web.config 设置正确,所以我认为我是正确的。有什么快速测试可以让我确定吗?
-
我想我明白为什么它不工作了,或者至少我认为我明白了。我在问题中添加了一个来自 Visual Studio 的屏幕截图,它显示了 GetImageServiceForRequest 方法,尽管在服务集合中有一个远程图像服务,但不返回任何服务。我不是 100% 确定,但我怀疑这应该返回服务,但它没有。以下http请求发出localhost:2371/media/1037/…
标签: image azure image-processing umbraco