48613

ImageResizer: Resize based on filename

Question:

Instead of specifying width and height in the querystring like this:

http://example.com/media/cow/small.png?w=100&h=100

Is it possible to configure Imageresizer to look at the filename (small.png) and use this information to scale it to 100x100?

This would allow me to request images like this:

http://example.com/media/cow/small.png http://example.com/media/cow/big.png

Answer1:

This is usually called URL rewriting. See

<ul><li><a href="https://stackoverflow.com/questions/18774853/using-imageresizing-with-a-custom-naming-convention" rel="nofollow">Using ImageResizer with a custom naming convention</a></li> <li><a href="https://stackoverflow.com/questions/11299837/how-can-i-set-up-custom-imageresizer-urls/11300150#11300150" rel="nofollow">How can I set up custom ImageResizer URLs</a></li> <li><a href="https://stackoverflow.com/questions/22592327/imageresizer-web-config-rewrite-rule-not-working-properly" rel="nofollow">Web.config rewrite rule</a></li> <li><a href="https://stackoverflow.com/questions/18522000/urlrewrite-iis-to-make-existing-image-urls-work-with-imageresizer/18561149#18561149" rel="nofollow">UrlRewrite IIS to make existing image urls work with ImageResizer</a></li> <li><a href="https://stackoverflow.com/questions/16287881/imageresizer-custom-urls-for-bundled-effects" rel="nofollow">ImageResizer custom urls for bundled effects</a></li> </ul>

We also define a Config.Pipeline.Defaults event to let people change default settings. It's just like URL rewriting, but provides 'default' behavior and only affects processed images.

Recommend

  • zeromq socket recv hanging
  • ImageResizer and VS 2015
  • Proper regex for .htaccess redirect and prevention of hotlinks
  • Hide text and display icons
  • Scalable images in Java
  • Emulating Node/Express Routes in .htaccess
  • php imagemagick create a Tiled Pyramid TIFF
  • how to change the div background image in mouse over [duplicate]
  • Unable to send a &str between threads because it does not live long enough
  • How to name a property when the preferred name is also the name of the type [duplicate]
  • save a juptyer notebook with specific name within the code
  • How can I ensure that the hornet queues are there when my webapp starts in JBOSS 6.0?
  • call ejb remote
  • Error after installing aws-sdk
  • Hibernate 5 ImplicitNamingStrategy
  • Read certain key from certain section of ini file (sed/awk ?)
  • Grails Packaging and Naming Conventions
  • Easier way to do non-recursive list on gcs bucket outside appengine
  • WebApp in AppServices vs CloudService
  • How do i find all references to a user control
  • How to name a 'group' check box in Adobe Reader when wanting to fill form by FDF / XFDF
  • Action Pack components in Rails
  • WPF version of .ScaleControl?
  • blade.php method outputting it's result to the form
  • D3 get axis values on zoom event
  • HTTP/2 streams vs HTTP/1.1 connections
  • Atlas images wrong size on iPad iOS 9
  • Syntax for setting draggablecursor property in google maps api
  • How to redirect a user to a different server and include HTTP basic authentication credentials?
  • Fill an image in a square container while keeping aspect ratio
  • Symfony2: How to get request parameter
  • Why winpcap requires both .lib and .dll to run?
  • GridView Sorting works once only
  • How to get icons for entities from eclipse?
  • log4net write single file for each call to log.info
  • Getting error when using KSoap library to consume .NET web services
  • How to set the response of a form post action to a iframe source?
  • how does django model after text[] in postgresql [duplicate]
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]
  • unknown Exception android