ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Properties | List of all members
ImageResizer.Plugins.Basic.IEPngFix Class Reference

Causes IE6 and earlier to use GIF versions of PNG files. By default, only fixes requests with ?iefix=true in the querystring. When catchall is enabled, it will filter all png images, unless iefix=false on those requests. Not compatible with CDNs or proxy servers, as they do not allow varying by user agent reliably. More...

Inheritance diagram for ImageResizer.Plugins.Basic.IEPngFix:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.Basic.IEPngFix:
Collaboration graph
[legend]

Public Member Functions

 IEPngFix (NameValueCollection settings)
 
IPlugin Install (Configuration.Config c)
 
bool Uninstall (Configuration.Config c)
 
IEnumerable< string > GetSupportedQuerystringKeys ()
 If the plugin reads any values from the querystring, the names of the keys should be specified here. This information is required so that the HttpModule knows when to handle an image request. More...
 
- Public Member Functions inherited from ImageResizer.Plugins.IPlugin
IPlugin Install (Config c)
 Installs the plugin in the specified Config instance. The plugin must handle all the work of loading settings, registering the plugin etc. More...
 
bool Uninstall (Config c)
 Uninstalls the plugin. Should reverse all changes made during Install More...
 

Static Public Member Functions

static bool NeedsPngFix (HttpContext context)
 Returns true if the user agent string specifies MSIE versions 1 through 6 for Windows. Cached in context.Items after first call. More...
 

Properties

bool CatchAll [get, set]
 If true, 'iefix=true' will be the default for all PNG images, instead of 'iefix=false'. More...
 
bool Redirect [get, set]
 If true, the requests from IE will be HTTP redirected to new URLs. If false, the GIF will be silently served instead of the PNG, without any redirection. A CDN or caching proxy will mess things up regardless, but using redirection ensures that the CDN/proxy never caches the GIF version instead of the PNG. More...
 

Detailed Description

Causes IE6 and earlier to use GIF versions of PNG files. By default, only fixes requests with ?iefix=true in the querystring. When catchall is enabled, it will filter all png images, unless iefix=false on those requests. Not compatible with CDNs or proxy servers, as they do not allow varying by user agent reliably.

Definition at line 19 of file IEPngFix.cs.

Member Function Documentation

IEnumerable<string> ImageResizer.Plugins.Basic.IEPngFix.GetSupportedQuerystringKeys ( )
inline

If the plugin reads any values from the querystring, the names of the keys should be specified here. This information is required so that the HttpModule knows when to handle an image request.

Returns

Implements ImageResizer.Plugins.IQuerystringPlugin.

Definition at line 124 of file IEPngFix.cs.

124  {
125  return new string[] { "iefix" };
126  }
static bool ImageResizer.Plugins.Basic.IEPngFix.NeedsPngFix ( HttpContext  context)
inlinestatic

Returns true if the user agent string specifies MSIE versions 1 through 6 for Windows. Cached in context.Items after first call.

Parameters
context
Returns

Definition at line 113 of file IEPngFix.cs.

113  {
114 
115  if (context == null || context.Request == null || string.IsNullOrEmpty(context.Request.UserAgent)) return false;
116  if (context.Items["isIE6orlower"] == null) {
117  bool needsFix = ie456.IsMatch(context.Request.UserAgent);
118  context.Items["isIE6orlower"] = needsFix;
119  return needsFix;
120  }
121  return (bool)context.Items["isIE6orlower"];
122  }

Property Documentation

bool ImageResizer.Plugins.Basic.IEPngFix.CatchAll
getset

If true, 'iefix=true' will be the default for all PNG images, instead of 'iefix=false'.

Definition at line 32 of file IEPngFix.cs.

bool ImageResizer.Plugins.Basic.IEPngFix.Redirect
getset

If true, the requests from IE will be HTTP redirected to new URLs. If false, the GIF will be silently served instead of the PNG, without any redirection. A CDN or caching proxy will mess things up regardless, but using redirection ensures that the CDN/proxy never caches the GIF version instead of the PNG.

Definition at line 43 of file IEPngFix.cs.


The documentation for this class was generated from the following file: