How can I use this information to retrieve the cropped images from storage, potentially using the media API? I cannot find the docs for this, but I assume I must be able to make two API calls to get "Featured image" and "Banner image"
The coordinates is probably null, because no custom crop has been set. So it just falls back to the focal point with a width and height, like the URL you provided.
Try actually changing the crop, by clicking the thumbnail and then moving/zoom the picture. Then it should generate another url specific to the crop.
Making an HTTP request to get cropped images
Hi,
I am using the content delivery and media API and I want to be able to retrieve an image for which I have created a crop for.
When I use the content delivery API to retrieve the document that contains the image and it's crops I get back the following structure:
How can I use this information to retrieve the cropped images from storage, potentially using the media API? I cannot find the docs for this, but I assume I must be able to make two API calls to get "Featured image" and "Banner image"
Thank you in advance.
Hi,
Umbraco would normally generate a crop URL like this (e.g. if using the GetCropUrl method in razor):
/media/4dlfie2y/fileexamplejpg_500kb.jpg?rxy=0.4980319840181882,0.0925965507120875&width=1200&height=750
I'm guessing in the content delivery API context we would need to build this URL manually by:
Problem is the coordinates property is null - this is the same for me too.
The coordinates is probably null, because no custom crop has been set. So it just falls back to the focal point with a width and height, like the URL you provided.
Try actually changing the crop, by clicking the thumbnail and then moving/zoom the picture. Then it should generate another url specific to the crop.
is working on a reply...