GetCropUrl with ImageCropMode.Crop don't add mode=...
# help-with-umbraco
l
I'm on a fairly fresh V 13.0.3 with converted content from V7. When making image urls with
GetCropUrl
passing
ImageCropMode.Crop
the images are still padded with black. No
mode="crop"
in the querystring. Adding
mode="crop"
manually makes the image actually crop instead of pad. Is this expected behavior? Am I missing something? Are my data bad? I'm stumped.
d
Hi there! If I remember correctly, there is an additional setting that you need to set in the GetCropUrl before it will actually crop. I don't remember which setting exactly it was.
useCropDimensions
maybe?
l
So this was me confusing ImageProcessor with ImageSharp. 🤦‍♂️ Don't ask...
h
I think to get it to crop, you must provide both a width and height value otherwise it does a resize
l
Cheers @huwred, but see my last comment. 🙈
r
the values are slightly changed in Imagesharp
l
I noticed. 🤭
I presume mode=crop is default with imagesharp but wasn't with imageprocessor. There's reasons I thought I was using sharp but was actually using processor. As mentioned, don't ask. 🤭
r
grins.. we all have moments
4 Views