diff --git a/src/Umbraco.Web/ImageCropperTemplateExtensions.cs b/src/Umbraco.Web/ImageCropperTemplateExtensions.cs index bcdea6eb03..0068f1547e 100644 --- a/src/Umbraco.Web/ImageCropperTemplateExtensions.cs +++ b/src/Umbraco.Web/ImageCropperTemplateExtensions.cs @@ -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);