Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have created a custom view for a block list. I'm trying to change the default "Pad" crop mode to "Crop" but getting the error ReferenceError: Crop is not defined
ReferenceError: Crop is not defined
Has anyone got any ideas to fix this?
angular.module("umbraco").controller("blockCustomHero", function ($scope, mediaResource, imageUrlGeneratorResource ) { var imageUdi = $scope.block.data.hero; mediaResource.getById(imageUdi) .then(function (media) { imageUrlGeneratorResource.getCropUrl(media.mediaLink, 1280, 250, Crop ).then(function (cropUrl) { console.log(cropUrl); $scope.imageUrl = cropUrl; }); });
});
Thanks
Hi Nathan
https://github.com/umbraco/Umbraco-CMS/blob/34e80d86e8c0b754f6b7a02e307f53cb32806bbe/src/Umbraco.Web.UI.Client/src/common/resources/imageurlgenerator.resource.js
I think it's expecting the CropMode to be specified as a string...
So would:
imageUrlGeneratorResource.getCropUrl(media.mediaLink, 1280, 250, "Crop" ).then(function (cropUrl) {
work for you?
regards
Marc
Thanks Marc, that's worked great
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Change crop mode in custom block list view
I have created a custom view for a block list. I'm trying to change the default "Pad" crop mode to "Crop" but getting the error
ReferenceError: Crop is not defined
Has anyone got any ideas to fix this?
});
Thanks
Hi Nathan
https://github.com/umbraco/Umbraco-CMS/blob/34e80d86e8c0b754f6b7a02e307f53cb32806bbe/src/Umbraco.Web.UI.Client/src/common/resources/imageurlgenerator.resource.js
I think it's expecting the CropMode to be specified as a string...
So would:
work for you?
regards
Marc
Thanks Marc, that's worked great
is working on a reply...