Ensure format processor is before quality processor.
(cherry picked from commit 69c725b3ec)
This commit is contained in:
committed by
Sebastiaan Janssen
parent
faf69e4349
commit
ba53b47b72
@@ -47,6 +47,7 @@ public class ImageSharpImageUrlGenerator : IImageUrlGenerator
|
||||
}
|
||||
|
||||
var queryString = new Dictionary<string, string?>();
|
||||
Dictionary<string, StringValues> furtherOptions = QueryHelpers.ParseQuery(options.FurtherOptions);
|
||||
|
||||
if (options.Crop is not null)
|
||||
{
|
||||
@@ -81,12 +82,17 @@ public class ImageSharpImageUrlGenerator : IImageUrlGenerator
|
||||
queryString.Add(ResizeWebProcessor.Height, options.Height?.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
if (furtherOptions.Remove(FormatWebProcessor.Format, out StringValues format))
|
||||
{
|
||||
queryString.Add(FormatWebProcessor.Format, format[0]);
|
||||
}
|
||||
|
||||
if (options.Quality is not null)
|
||||
{
|
||||
queryString.Add(QualityWebProcessor.Quality, options.Quality?.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
foreach (KeyValuePair<string, StringValues> kvp in QueryHelpers.ParseQuery(options.FurtherOptions))
|
||||
foreach (KeyValuePair<string, StringValues> kvp in furtherOptions)
|
||||
{
|
||||
queryString.Add(kvp.Key, kvp.Value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user