Update AngularJS image URL parameters
This commit is contained in:
@@ -42,7 +42,7 @@
|
||||
|
||||
var path = umbRequestHelper.convertVirtualToAbsolutePath(vm.blockConfigModel.thumbnail);
|
||||
if (path.toLowerCase().endsWith(".svg") === false) {
|
||||
path += "?upscale=false&width=400";
|
||||
path += "?width=400";
|
||||
}
|
||||
vm.styleBackgroundImage = 'url(\''+path+'\')';
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(function () {
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
@@ -55,7 +55,7 @@
|
||||
if (thumbnail) {
|
||||
if (mediaHelper.detectIfImageByExtension(property.value)) {
|
||||
//get default big thumbnail from image processor
|
||||
var thumbnailUrl = property.value + "?rnd=" + moment(entity.updateDate).format("YYYYMMDDHHmmss") + "&width=500&animationprocessmode=first";
|
||||
var thumbnailUrl = property.value + "?width=500&rnd=" + moment(entity.updateDate).format("YYYYMMDDHHmmss");
|
||||
return thumbnailUrl;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -73,25 +73,22 @@ angular.module("umbraco")
|
||||
url += `?crop=${coords.x1},${coords.y1},${coords.x2},${coords.y2}&cropmode=percentage`;
|
||||
} else {
|
||||
// Here in order not to break existing content where focalPoint were used.
|
||||
// For some reason width/height have to come first when mode=crop.
|
||||
if ($scope.control.value.focalPoint) {
|
||||
url += `?center=${$scope.control.value.focalPoint.top},${$scope.control.value.focalPoint.left}`;
|
||||
url += '&mode=crop';
|
||||
url += `?rxy=${$scope.control.value.focalPoint.top},${$scope.control.value.focalPoint.left}`;
|
||||
} else {
|
||||
// Prevent black padding and no crop when focal point not set / changed from default
|
||||
url += '?center=0.5,0.5&mode=crop';
|
||||
url += '?rxy=0.5,0.5';
|
||||
}
|
||||
}
|
||||
|
||||
url += '&width=' + $scope.control.editor.config.size.width;
|
||||
url += '&height=' + $scope.control.editor.config.size.height;
|
||||
url += '&animationprocessmode=first';
|
||||
}
|
||||
|
||||
// set default size if no crop present (moved from the view)
|
||||
if (url.includes('?') === false)
|
||||
{
|
||||
url += '?width=800&upscale=false&animationprocessmode=false'
|
||||
url += '?width=800'
|
||||
}
|
||||
|
||||
return url;
|
||||
|
||||
@@ -234,7 +234,7 @@ angular.module('umbraco')
|
||||
if (property.value && property.value.src) {
|
||||
|
||||
if (thumbnail === true) {
|
||||
return property.value.src + "?width=500&mode=max&animationprocessmode=first";
|
||||
return property.value.src + "?width=500";
|
||||
}
|
||||
else {
|
||||
return property.value.src;
|
||||
|
||||
Reference in New Issue
Block a user