Hi, has anyone faced the issue of the ImageResizer not working on DXC? If so could you please suggest how to get this going. I am using the ImageResizer.Plugins.EPiServerBlobReader plugin. The URL is getting rendered fine, and I see the ImageResizer width and height paremeters in the query string as well. But the image is not getting re-sized.
Below is a sample of the URL:
Below are the steps of how I am trying to do this:
Installed ImageResizer.Plugins.EPiServerBlobReader nuget package (6.0.3) as we are on EpiServer CMS 10This added a httpmodule node into the Web.config file
I then added the below code into the cshtml file to re-size
This is working on my local machine which is not a DXC environment, but we are using DXC for the production version and that doesnt seem to work.
I think you need to give us more information before we can help. What is not working, no URLs are rendered or URL rendered but no image is displayed? Do the images give you 404 or 500 response code? Do you have any errors or logs?
@Johan Petersson: Thank you for the reply, I have mentioned all the details with regards to my issue. I hope this is sufficient to help you understand the problem.
Uploaded images in Episerver that aren't using ImageResizer, are they working as expected? If you place an image inside an XhtmlString property, e.g. MainBody, are they working? Trying to figure out if ImageResizer is the problem or images in general in DXC-S.
@Johan Petersson: The images seem to be fine as we have them in the MainBody and they are rendered properly. It is only the re-sizing that is not working. I basically took one of the Image resizing URLs and opened it in a new tab, ideally it would re-size the image based on the height and width. But that doesnt seem to happen in the DXC environment.
I'm not familiar with ImageResizer.Plugins.EPiServerBlobReader. But I guess this add-on needs some sort of configuration, e.g. where it should cache the resized images? Or are you using the same blob storage account locally when it's working?
@John Petersson: Thank you for guiding me in the right direction, it was bascially a web.config tweak :)
which web.config tweak was needed for this to work in DXC?
@Vishal, basically I did not have all the configurations set right. Below are the configs you might want to confirm:
Make sure the below config is present under <configSections> node:
<section name="resizer" type="ImageResizer.ResizerSection" requirePermission="false"/>
Make sure the below config is present under <system.web> node:
<httpModules> <add name="ImageResizingModule" type="ImageResizer.InterceptModule" /> </httpModules>
Added the below mentioned snippet under <configuration> node:
<resizer> <clientcache minutes="720" /> [This was something we added to cache the images for 12 Hrs , this is not mandatory] <plugins> <add name="EPiServerBlobReaderPlugin" /> </plugins> </resizer>
Hope this helps.
Check out my colleague Vincent Baaij's work around this area too. I'd say its defintiely worth a look https://world.episerver.com/blogs/vincent-baaij/dates/2018/7/imageprocessor-web-episerver-new-versions/
yes i have used that, but there is an issue with that package incombination with DXC and (used) CDN making the images perform bad. Vincent also looked into it but couldnt find the problem.
So that package works good if you are not using DXC with CDN. We couldnt wait much longer on a solution, so we switched now to ImageResizer which works as expected.
I did make some progress on this. The latest version (4.2) works as expected on an Azure environment with a Cloudflare CDN! As you can see from the image below, it gets deliverd from the Cloudflare cache. It does take a short period of time for the cf-cahce-status to chage from MISS to HIT (like 30 seconds). I worked with other Episerver people to find out what the default Cloudflare settings are with regards to querystring parameters and made sure that it works with those settings on my test setup. I don't have access to an actual DXC-S test environment, but it should work there as well.
Thats great news Vincent,
i want to try this again for you on our Integration environment to see the effects. Only i'm going on holiday next week, so after that i can try to see how it performs..
Thanks again for helping out and i'm sure that this package will be a great free option for many of us out there.
Thanks Vishal. No rush. Lookig forward to the test results!
@Vincent, what was the issue?
@valdis there were some issues in the code with the url's and the way that cached images were returned in the end I didn't change that much but it was a good exercise in understanding somebody else's code