Skip to content

Commit

Permalink
Fix #44
Browse files Browse the repository at this point in the history
  • Loading branch information
vnbaaij committed Dec 9, 2020
1 parent 06a5e85 commit e8f556b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ GetPictureData parameters are similar to the parameters for the Picture html hel

## Change log
To get a more exact overview of the changes, you can also take a look at the commit history.
#### V5.6.3
#### V5.6.5
- Fix #44. When '#' is found in color string for Tint, it will now be encoded in UrlBuilder.
#### V5.6.4
- Fix #41 (thanks Erik!)
#### V5.6.3
- Fix #38 (hopefully)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Configuration;
using System.Drawing;
using System.Globalization;
using System.Web;
using System.Web.Mvc;
using EPiServer;
using ImageProcessor.Imaging;
Expand Down Expand Up @@ -972,16 +973,20 @@ public static UrlBuilder Tint(this UrlBuilder target, string color)
throw new ArgumentNullException(nameof(target));

if (!target.IsEmpty)
target.QueryCollection.Add("tint", color.ToLower());

{
string t = color.ToLower();
if (t.Contains("#"))
t = HttpUtility.UrlEncode(t);
target.QueryCollection.Add("tint", t);
}
return target;
}

/// <summary>
/// Tints the current image with the given color.
/// </summary>
/// <param name="target"></param>
/// <param name="color">In KnoColor format.</param>
/// <param name="color">In KnownColor format.</param>
/// <returns></returns>
public static UrlBuilder Tint(this UrlBuilder target, KnownColor color)
{
Expand Down
4 changes: 2 additions & 2 deletions src/ImageProcessor.Web.Episerver/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyVersion("5.6.4.*")]
[assembly: AssemblyFileVersion("5.6.4.0")]
[assembly: AssemblyVersion("5.6.5.*")]
[assembly: AssemblyFileVersion("5.6.5.0")]

0 comments on commit e8f556b

Please sign in to comment.