Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of "scale" filter to avoid grained images #8713

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ public MediaShapes(Work<IImageProfileManager> imageProfileManager) {
public ILogger Logger { get; set; }

[Shape]
public void ResizeMediaUrl(dynamic Shape, dynamic Display, TextWriter Output, ContentItem ContentItem, string Path, int Width, int Height, string Mode, string Alignment, string PadColor) {
public void ResizeMediaUrl(dynamic Shape, dynamic Display, TextWriter Output, ContentItem ContentItem, string Path, int Width, int Height, string Mode, string Alignment, string PadColor, string Scale= "upscaleOnly") {
var state = new Dictionary<string, string> {
{"Width", Width.ToString(CultureInfo.InvariantCulture)},
{"Height", Height.ToString(CultureInfo.InvariantCulture)},
{"Mode", Mode},
{"Alignment", Alignment},
{"PadColor", PadColor},
{"Scale", Scale},
};

var filter = new FilterRecord {
Expand All @@ -42,7 +43,8 @@ public void ResizeMediaUrl(dynamic Shape, dynamic Display, TextWriter Output, Co
+ "_h_" + Convert.ToString(Height)
+ "_m_" + Convert.ToString(Mode)
+ "_a_" + Convert.ToString(Alignment)
+ "_c_" + Convert.ToString(PadColor);
+ "_c_" + Convert.ToString(PadColor)
+ "_s_" + Convert.ToString(Scale);

MediaUrl(Shape, Display, Output, profile, Path, ContentItem, filter);
}
Expand Down