Merge pull request #1398 from arknu/U4-8751_2

U4-8751: Put format parameter at the end when format is specified in furtherOptions
This commit is contained in:
Sebastiaan Janssen
2016-08-02 14:57:38 +02:00
committed by GitHub

View File

@@ -302,7 +302,11 @@ namespace Umbraco.Web
}
}
if (quality != null)
bool hasFormat = furtherOptions != null && furtherOptions.Contains("&format=");
//Only put quality here, if we don't have a format specified.
//Otherwise we need to put quality at the end to avoid it being overridden by the format.
if (quality != null && !hasFormat)
{
imageProcessorUrl.Append("&quality=" + quality);
}
@@ -351,6 +355,12 @@ namespace Umbraco.Web
imageProcessorUrl.Append(furtherOptions);
}
//If furtherOptions contains a format, we need to put the quality after the format.
if (quality != null && hasFormat)
{
imageProcessorUrl.Append("&quality=" + quality);
}
if (cacheBusterValue != null)
{
imageProcessorUrl.Append("&rnd=").Append(cacheBusterValue);