Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Good day all!
I have a new v12 site and am attempting to use the ImageCropper. I am following the docs from this page - https://docs.umbraco.com/umbraco-cms/fundamentals/backoffice/property-editors/built-in-umbraco-property-editors/image-cropper#powered-by-imagesharp.web
Whether I try
<img src="@Url.GetCropUrl(Model.Photo,"cropName")" />
<img src="@Url.GetCropUrl(Model.Photo, height: 300, width: 400)" alt="@Model.Photo.Name" />
On render I get the modified URL as expected
but no change to the image. It seems that the query string parameters are ignored. Should I need to do any of the
or should it "just work" out of the box?
Does this have to do with the new licensing for ImageSharp?
Happy to share more details if necessary.
It should just work out of the box, can you check your URL is not HTML encoded?
Try this in your address bar and see if it returns the processed image:
I don't know if the forum added the encoding or if that has come from your end?
Even in it's simplest form, this should resize an image:
If that doesn't work, maybe check for any errors in the logs as Image Sharp should be added automatically by Umbraco.
Yep, you nailed it! Using your examples with non-encoded URLs works as expected! Not sure why they are being encoded in the first place (or why that didn't jump out at me), but that is absolutely the problem!
Thanks Justin for helping me out on this H5YR!!
All good :-)
var img = slide.Value<IPublishedContent>("slideImage");
<img src="@Url.GetCropUrl(img, height: 300, width: 400, htmlEncode: false)" />
No problem, glad that was the answer!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted