I'm using Hangfire to start some long running background jobs in which I (amongst other things) want to try and use the cropped url for images/media.
However, seeing as I do not have access to the HttpContext and UmbracoHelper in these jobs, I cannot just use the IPublishedContent extension GetCropUrl.
I have noticed it seems I have access to the ApplicationContext and Services, so is it possible to get a crop url via the API in some other manner?
Hi.
Thanks for the reply, but accessing the ImageProcessor seems to be to do the actual cropping, which I'm not interested in doing manually.
I'm trying to determine what URL an IMedia loaded from - for example - the MediaService would get when I do not have access to the IPublishedContent.GetCropUrl("cropsetting") extension method.
The cropping etc will still be done normally.
It seems there is a GetCropUrl which is extending on a normal string (URL) so I suspect it should be completely possible; however - I cannot seem to find documentation regarding getting the URL out of IMedia and getting the CropSettings from a Crop Alias
I dug into the code and actually found an obsolete ImageUrlProvider which seems to be able to do much of what I would like to do (GetImageUrlFromMedia).
However it's not mentioned what will be replace this obsolete method/Provider?
Get CropUrl without HttpContext
Hi.
I'm using Hangfire to start some long running background jobs in which I (amongst other things) want to try and use the cropped url for images/media. However, seeing as I do not have access to the HttpContext and UmbracoHelper in these jobs, I cannot just use the IPublishedContent extension GetCropUrl.
I have noticed it seems I have access to the ApplicationContext and Services, so is it possible to get a crop url via the API in some other manner?
Thanks in advance.
Hi Allan,
GetCropUrl wraps around ImageProcessor so if you know the settings you want to use you could do so directly
http://imageprocessor.org/imageprocessor/imagefactory/
Matt
Hi. Thanks for the reply, but accessing the ImageProcessor seems to be to do the actual cropping, which I'm not interested in doing manually.
I'm trying to determine what URL an IMedia loaded from - for example - the MediaService would get when I do not have access to the IPublishedContent.GetCropUrl("cropsetting") extension method. The cropping etc will still be done normally.
It seems there is a GetCropUrl which is extending on a normal string (URL) so I suspect it should be completely possible; however - I cannot seem to find documentation regarding getting the URL out of IMedia and getting the CropSettings from a Crop Alias
I dug into the code and actually found an obsolete ImageUrlProvider which seems to be able to do much of what I would like to do (GetImageUrlFromMedia).
However it's not mentioned what will be replace this obsolete method/Provider?
is working on a reply...