mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Merge pull request #6130 from musukvl/issue/6091
[Fixes #6091] ImageProfileManager.GetImageProfileUrl can take multiple customFilters at a time.
This commit is contained in:
commit
9732c61b0f
@ -7,5 +7,6 @@ namespace Orchard.MediaProcessing.Services {
|
||||
string GetImageProfileUrl(string path, string profileName, ContentItem contentItem);
|
||||
string GetImageProfileUrl(string path, string profileName, FilterRecord customFilter);
|
||||
string GetImageProfileUrl(string path, string profileName, FilterRecord customFilter, ContentItem contentItem);
|
||||
string GetImageProfileUrl(string path, string profileName, ContentItem contentItem, params FilterRecord[] customFilters);
|
||||
}
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ namespace Orchard.MediaProcessing.Services {
|
||||
|
||||
public ILogger Logger { get; set; }
|
||||
|
||||
public string GetImageProfileUrl(string path, string profileName) {
|
||||
return GetImageProfileUrl(path, profileName, null, null);
|
||||
public string GetImageProfileUrl(string path, string profileName) {
|
||||
return GetImageProfileUrl(path, profileName, null, new FilterRecord[] { });
|
||||
}
|
||||
|
||||
public string GetImageProfileUrl(string path, string profileName, ContentItem contentItem) {
|
||||
@ -57,6 +57,10 @@ namespace Orchard.MediaProcessing.Services {
|
||||
}
|
||||
|
||||
public string GetImageProfileUrl(string path, string profileName, FilterRecord customFilter, ContentItem contentItem) {
|
||||
return GetImageProfileUrl(path, profileName, contentItem, customFilter);
|
||||
}
|
||||
|
||||
public string GetImageProfileUrl(string path, string profileName, ContentItem contentItem, params FilterRecord[] customFilters) {
|
||||
|
||||
// path is the publicUrl of the media, so it might contain url-encoded chars
|
||||
|
||||
@ -108,7 +112,7 @@ namespace Orchard.MediaProcessing.Services {
|
||||
|
||||
ImageProfilePart profilePart;
|
||||
|
||||
if (customFilter == null) {
|
||||
if (customFilters == null || !customFilters.Any()) {
|
||||
profilePart = _profileService.GetImageProfileByName(profileName);
|
||||
if (profilePart == null)
|
||||
return String.Empty;
|
||||
@ -116,7 +120,9 @@ namespace Orchard.MediaProcessing.Services {
|
||||
else {
|
||||
profilePart = _services.ContentManager.New<ImageProfilePart>("ImageProfile");
|
||||
profilePart.Name = profileName;
|
||||
profilePart.Filters.Add(customFilter);
|
||||
foreach (var customFilter in customFilters) {
|
||||
profilePart.Filters.Add(customFilter);
|
||||
}
|
||||
}
|
||||
|
||||
// prevent two requests from processing the same file at the same time
|
||||
|
Loading…
Reference in New Issue
Block a user