Hi,
I see imageCropMode default is "Pad". I want to set imageCropMode: ImageCropMode.Crop as default mode for all GetCropUrl() calls.
Is there a setting in appsettings or any other configuration available to set default cropmde?
Version: Umbraco 13
TIA
So you would probably need to create your own extension method GetOsmansCropUrl that would act as a wrapper around GetCropUrl, but always set the Crop Mode to your desired default type.
There isn't a way to configure the default crop mode from appsettings etc
I use custom code to generate image crop urls. It was working on 13.2.0. After upgrading to 13.2.1 GetCropUrl() started adding crop mode Pad.
I updated my code and added mageCropMode: ImageCropMode.Crop. Now it works fine.
Setting imageCropMode site wide
Hi, I see imageCropMode default is "Pad". I want to set imageCropMode: ImageCropMode.Crop as default mode for all GetCropUrl() calls. Is there a setting in appsettings or any other configuration available to set default cropmde? Version: Umbraco 13 TIA
Hi Osman
As you might have found, I think this is the line that defaults the crop mode to Pad for GetCropUrl...
https://github.com/umbraco/Umbraco-CMS/blob/ce372abf8a87398e0a8d485f86caf00567e9ef73/src/Umbraco.Web.Common/Extensions/ImageCropperTemplateCoreExtensions.cs#L484
So you would probably need to create your own extension method GetOsmansCropUrl that would act as a wrapper around GetCropUrl, but always set the Crop Mode to your desired default type.
There isn't a way to configure the default crop mode from appsettings etc
Regards
Marc
Hi Marc,
I use custom code to generate image crop urls. It was working on 13.2.0. After upgrading to 13.2.1 GetCropUrl() started adding crop mode Pad. I updated my code and added mageCropMode: ImageCropMode.Crop. Now it works fine.
Thanks & regards...
is working on a reply...