如何在 Umbraco 中使用图像裁剪器

how to use image cropper in Umbraco

我在umbraco 中使用过图像裁剪器。我可以在内容选项卡上看到图像。我已保存并发布。我在网站上只能看到:

{
    "src": "/media/1023/stickyfooter.png",
    "focalPoint": {
        "left": 0.60666666666666669,
        "top": 0.32544378698224852
    },
    "crops": [{
        "alias": "fac",
        "width": 1000,
        "height": 500,
        "coordinates": null
    }]
}

我做错了什么?

这是为图像裁剪器存储的原始数据,您需要使用 getCropUrl() 辅助方法来获取图像的特定 URL,而不是原始数据。它应该类似于

@Url.GetCropUrl(Model.Content, "yourImagePropertyName", "fac")  

它多年来发生了一些变化,因此具体方法可能会根据您的 Umbraco 版本而变化。有关详细信息,请参阅 https://our.umbraco.com/documentation/getting-started/backoffice/property-editors/built-in-property-editors/image-cropper#sample-code