9

Having same issue as many others in regards to Umbraco ImageProcessor not cropper. I am currently using Version 7.4 but 7.3 also does not crop image at all.

I am using Azure Blob storage, with CDN have followed configuration setup to the a tee.

Full image is getting uploaded into Azure Storage via Umbraco Back Office but have tried various formatted URL requests to pull and crop image but none have worked whether JPG or PNG file. No cropping occurs at all, always full image is returned.

Using fiddler, I can see that the request is going to Azure Blob to retrieve image, but no matter the crop size, always returns full image size.

http://localhost:10876/media/1022/grower.jpg?center=0.70666666666666667,0.505&mode=crop&width=100&height=50&rnd=130950810990000000

Packages Config ...

<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" />

Web Config ...

  <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>

enter image description here

user1333524
  • 463
  • 5
  • 17
  • First thing to check is are there any errors logged in the Log File? – Robert Foster Dec 21 '15 at 06:19
  • Thank you for your reply. I should have noted in my question as I had checked for errors in the log files. No errors. Is there a recommended approach to stepping through the image processor logic or other ways to determine that it's even running. – user1333524 Dec 21 '15 at 13:07
  • 1
    There is an extremely long thread on this here: https://our.umbraco.org/projects/backoffice-extensions/azure-blob-storage-provider/your-remarks-ideas-etc/64307-Image-CropperImage-Processor-Crops hopefully that might help? – Tim Dec 24 '15 at 09:32
  • Thanks for the link Tim but according to the comments on that thread I have installed and setup my configurations correctly and still no cropping is happening. The images are saving and flowing to and from Blob storage perfectly fine, the caching to CDN also working well. Security configuration is working for I wasn't able to retrieve initially until I added proper white list. I don't even know if I am running through Image Processor Module/Handler. The web.config is setup correctly so I assume I am. Is there any quick test I can run to know for sure? – user1333524 Dec 28 '15 at 13:48
  • I think I see why it's not working, or at least I think I see. I added a screen shot from visual studio to question which shows the method GetImageServiceForRequest which although has a Remote Image Service in the Services collection, does not return any service. I am not 100% certain, but I suspect this should return the service however it does not. The following http request was issued http://localhost:2371/media/1037/grower.jpg?center=0.70333333333333337,0.52&mode=crop&width=100&height=550&rnd=130957088530000000 – user1333524 Dec 28 '15 at 18:00

2 Answers2

2

The issue I was having was due to a miss-understanding on how to setup the CloudImageService within the security.config file. As mentioned I found when I stepped through the code, that although I had remote image service configured, it was not using it. The key was the prefix attribute within CloudImageService must be set to Media/ so that it aligns to the image URL path startswith .. http://localhost:1234/media/image.png... Once I had that setup correctly I am now able to see changes when I request different width/height etc. That only took me a week to resolve.

user1333524
  • 463
  • 5
  • 17
  • Thank you for this; I didn't know if you meant that `Media/` needed to be case sensitive (I'm still unsure if that is the case) - but I had `/media` instead of `media/` which was the breaking problem in the end – Joe van de Bilt Jan 05 '22 at 12:10
0

I had a similar issue, however none of the solutions I read online worked, or my config was already set as suggested, and I manually checked all dll versions and all were fine.

What finally resolved the issue for me is I changed the .NET Version from 4.5.2 to 4.6 This essentially broke my build, and the project would not work, so I reverted back to 4.5.2, the project built and ran again, and the cropping now worked!

I suspect the .NET versions are immaterial, but the act of changing versions flushed out the error.