Merge remote-tracking branch 'umbraco/temp-7538-image-url-generator' into netcore/dev

# Conflicts:
#	src/Umbraco.Abstractions/IImageUrlGenerator.cs
#	src/Umbraco.Abstractions/ImageUrlGenerationOptions.cs
#	src/Umbraco.Core/Composing/Current.cs
#	src/Umbraco.Core/Models/UserExtensions.cs
#	src/Umbraco.Core/PropertyEditors/ValueConverters/ImageCropperValue.cs
#	src/Umbraco.Core/Umbraco.Core.csproj
#	src/Umbraco.Tests/PropertyEditors/ImageCropperTest.cs
#	src/Umbraco.Tests/PublishedContent/PublishedContentTestBase.cs
#	src/Umbraco.Tests/PublishedContent/PublishedContentTests.cs
#	src/Umbraco.Tests/Runtimes/StandaloneTests.cs
#	src/Umbraco.Tests/Testing/UmbracoTestBase.cs
#	src/Umbraco.Web/PropertyEditors/GridPropertyEditor.cs
#	src/Umbraco.Web/PropertyEditors/RichTextPropertyEditor.cs
#	src/Umbraco.Web/Runtime/WebInitialComposer.cs
#	src/Umbraco.Web/Templates/TemplateUtilities.cs
This commit is contained in:
Benjamin Carleski
2020-02-11 11:43:54 -08:00
34 changed files with 1059 additions and 571 deletions

View File

@@ -1,6 +1,7 @@
@using Umbraco.Core.Models.PublishedContent
@using Umbraco.Web
@using Umbraco.Core
@using Umbraco.Core.Models
@using Umbraco.Web.Composing
@inherits Umbraco.Web.Macros.PartialViewMacroPage
@@ -46,7 +47,7 @@
{
<div class="col-xs-6 col-md-3">
<a href="@item.Url()" class="thumbnail">
<img src="@item.GetCropUrl(width:200, height:200)" alt="@item.Name" />
<img src="@(item.GetCropUrl(Current.Factory.GetInstance<IImageUrlGenerator>(), width:200, height:200))" alt="@item.Name" />
</a>
</div>
}

View File

@@ -2,20 +2,24 @@
@using Umbraco.Web.Templates
@if (Model.value != null)
{
{
var url = Model.value.image;
if(Model.editor.config != null && Model.editor.config.size != null){
url += "?width=" + Model.editor.config.size.width;
url += "&height=" + Model.editor.config.size.height;
if(Model.value.focalPoint != null){
url += "&center=" + Model.value.focalPoint.top +"," + Model.value.focalPoint.left;
url += "&mode=crop";
}
url = ImageCropperTemplateCoreExtensions.GetCropUrl(url, Umbraco.Web.Composing.Current.Factory.GetInstance<IImageUrlGenerator>(),
width: Model.editor.config.size.width,
height: Model.editor.config.size.height,
cropDataSet: Model.value.focalPoint == null ? null : new Umbraco.Core.PropertyEditors.ValueConverters.ImageCropperValue
{
FocalPoint = new Umbraco.Core.PropertyEditors.ValueConverters.ImageCropperValue.ImageCropperFocalPoint
{
Top = Model.value.focalPoint.top,
Left = Model.value.focalPoint.left
}
});
}
var altText = Model.value.altText ?? Model.value.caption ?? string.Empty;
<img src="@url" alt="@altText">
if (Model.value.caption != null)