|
string | parseResizeFolderSyntax (string path, NameValueCollection q) |
| Parses and removes the resize folder syntax "resize(x,y,f)/" from the specified file path. Places settings into the referenced querystring More...
|
|
|
Regex | resizeFolder |
| Matches /resize(x,y,f)/ syntax Fixed Bug - will replace both slashes.. make first a lookbehind More...
|
|
Definition at line 9 of file FolderResizeSyntax.cs.
string ImageResizer.Plugins.Basic.FolderResizeSyntax.parseResizeFolderSyntax |
( |
string |
path, |
|
|
NameValueCollection |
q |
|
) |
| |
|
inlineprotected |
Parses and removes the resize folder syntax "resize(x,y,f)/" from the specified file path. Places settings into the referenced querystring
- Parameters
-
path | |
q | The collection to place parsed values into |
- Returns
Definition at line 48 of file FolderResizeSyntax.cs.
49 Match m = resizeFolder.Match(path);
52 int maxwidth = -1;
if (!
int.TryParse(m.Groups[
"maxwidth"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out maxwidth)) maxwidth = -1;
53 int maxheight = -1;
if (!
int.TryParse(m.Groups[
"maxheight"].Value, NumberStyles.Integer, NumberFormatInfo.InvariantInfo, out maxheight)) maxheight = -1;
54 string format = (m.Groups[
"format"].Captures.Count > 0) ? format = m.Groups[
"format"].Captures[0].Value : null;
60 if (maxwidth > 0) q[
"maxwidth"] = maxwidth.ToString(NumberFormatInfo.InvariantInfo);
61 if (maxheight > 0) q[
"maxheight"] = maxheight.ToString(NumberFormatInfo.InvariantInfo);
62 if (format != null) q[
"format"] = format;
string parseResizeFolderSyntax(string path, NameValueCollection q)
Parses and removes the resize folder syntax "resize(x,y,f)/" from the specified file path...
Regex resizeFolder
Matches /resize(x,y,f)/ syntax Fixed Bug - will replace both slashes.. make first a lookbehind ...
Regex ImageResizer.Plugins.Basic.FolderResizeSyntax.resizeFolder |
|
protected |
Initial value:= new Regex(@"(?<=^|\/)resize\(\s*(?<maxwidth>\d+)\s*,\s*(?<maxheight>\d+)\s*(?:,\s*(?<format>jpg|png|gif)\s*)?\)\/", RegexOptions.Compiled
| RegexOptions.IgnoreCase)
Matches /resize(x,y,f)/ syntax Fixed Bug - will replace both slashes.. make first a lookbehind
Definition at line 37 of file FolderResizeSyntax.cs.
The documentation for this class was generated from the following file: