Random sorting of list

You can do a random sorting of a list with LINQ by using:



Installing ImageResizer in a new project

This will include the optional DiskCache that saves the scaled images to the disk.

Download from nuget:

  • ImageResizer
  • ImageResizer.Plugins.DiskCache (optional)

Put inside web.config following snippets:

    <section name="resizer" type="ImageResizer.ResizerSection" requirePermission="false" />
      <add name="ImageResizingModule" type="ImageResizer.InterceptModule" />


And here comes the settings, you can change the values to whatever you want. They are quite self explained. Presets are pre defined scales like "medium" and "small" for me. You can either have it dynamically in each call to an image or set it it "onlyAllowPresets", which then uses those.

      <add name="Presets" />
      <add name="DiskCache" />
    <presets onlyAllowPresets="false">
      <preset name="medium" settings="width=600;height=600;scale=canvas" />
      <preset name="small" settings="width=250;height=250;scale=canvas" />
    <clientcache minutes="1440" />
    <diskCache dir="~/ImageResizer/" autoClean="false" hashModifiedDate="true" enabled="true" subfolders="32" cacheAccessTimeout="15000" />

Usage example:

  • dev.yoursite.com/cat_1.jpg?preset=medium   (With preset)
  • dev.yoursite.com/cat_2.jpg?w=170&h=170&mode=pad

Published: 2016-08-22