ImageResizer not working in DXC

Siddharth Gupta
Member since: 2018
 

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:

http://test.com/globalassets/article-images/image.jpg?w=100&h=100

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 10
This added a httpmodule node into the Web.config file


      
      

I then added the below code into the cshtml file to re-size

@using ImageResizer.Plugins.EPiServer

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.

#191514 Edited, Apr 24, 2018 22:50
  • Johan Petersson
    Member since: 2007
     

    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?

    #191527 Apr 25, 2018 8:46
  • Siddharth Gupta
    Member since: 2018
     

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

    #191645 Apr 25, 2018 16:33
  • Johan Petersson
    Member since: 2007
     

    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.

    #191646 Apr 25, 2018 16:39
  • Siddharth Gupta
    Member since: 2018
     

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

    #191647 Apr 25, 2018 16:45
  • Johan Petersson
    Member since: 2007
     

    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?

    #191648 Apr 25, 2018 17:07
  • Siddharth Gupta
    Member since: 2018
     

    @John Petersson: Thank you for guiding me in the right direction, it was bascially a web.config tweak :)

    #191650 Apr 25, 2018 17:57
  • Vishal Panday
    Member since: 2011
     

    Hi Siddharth,

    which web.config tweak was needed for this to work in DXC?

    #197352 Oct 01, 2018 11:07
  • Siddharth Gupta
    Member since: 2018
     

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

    #197358 Edited, Oct 01, 2018 15:38
  •  

    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/

    #197609 Oct 09, 2018 7:40
  • Vishal Panday
    Member since: 2011
     

    HI Marcus,

    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. 

    #197611 Oct 09, 2018 8:06
  • Vincent Baaij
    Member since: 2016
     

    Hi Vishal,

    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.

    #198059 Oct 19, 2018 12:51
  • Vishal Panday
    Member since: 2011
     

    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. 

    #198060 Oct 19, 2018 13:00
  • Vincent Baaij
    Member since: 2016
     

    Thanks Vishal. No rush. Lookig forward to the test results!

    #198062 Oct 19, 2018 13:04
  • valdis iljuconoks
    Member since: 2011
     

    @Vincent, what was the issue?

    #198070 Oct 19, 2018 14:39
  • Vincent Baaij
    Member since: 2016
     

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

    #198077 Oct 19, 2018 18:33