If so, it should work (have the same example right infront of me : @newsItem.Image.GetCropUrl(400,400, furtherOptions:"&format=WebP"))
Could you post the URL that is visible in the frontend ? (the parameters).
I've had some issues with this, but only when getting the actual crop from an alias (had to reselect the cropped area). Not directly of an selected Image..
I don't think it has to do with the webp format. I also tried without the webp extension and got the same issue (well without the formation conversion issue as it was not requested)
I remove the azure blob configuration from the appsetting and the .AddAzureBlobMediaFileSystem() from the ConfigureServices and all my images went broken (so far so good)
I added a new image via the back office of umbraco and tried again and... the new image is not cropped either :'(
So I tried to change some configuration and nothing worked.
So I made a clean install of umbraco and literally copy/pasted the content of the Startup.cs file in my project and now the ImageSharp crops works like a charm.
It seems that I broke something with my modifications in the Startup.cs file, I will keep posted when I find what was the exact issue.
To build on that for anyone else that encounters this.
Today I encountered the same thing (Umbraco 10.2.1.7). The problem is I can't remove app.UseStaticFiles() since that is needed for some other functionality.
When this happens you can simply bypass the /media/ folder by changing the configuration to:
GetCropUrl doesn't resize the image on Umbraco 10
Hi,
I migrated from Umbraco 9 to Umbraco 10 and I think everything run fine but ImageSharp which doesn't want to resize my images.
My code is as follow:
image.GetCropUrl(width: 600, height:400, quality:80, furtherOptions: "&format=webp")
but the resulted image is neither resized/cropped nor rended in a webp format.
Do you have any idea where it can come from (probably a mis configuration somewhere, but I can't find it).
Thanks
Is
image
an MediaWithCrops?If so, it should work (have the same example right infront of me :
@newsItem.Image.GetCropUrl(400,400, furtherOptions:"&format=WebP")
)Could you post the URL that is visible in the frontend ? (the parameters).
I've had some issues with this, but only when getting the actual crop from an alias (had to reselect the cropped area). Not directly of an selected Image..
image is indeed a MediaWithCrops object
The created url is as follow:
/media/trxbtnzn/my-image.jpg?width=600&height=400&quality=80&format=webp&rnd=132925045782200000
the image appears correctly, but is not cropped as expected
Hi Pierre, did you check documentatino for WebP Image Support?
It mentions a few things you can check like (imageprocessor version in umbraco10, msvcr123.dll on your localhost/production server, etc.): https://imageprocessor.org/imageprocessor/plugins/webp/
I don't think it has to do with the webp format. I also tried without the webp extension and got the same issue (well without the formation conversion issue as it was not requested)
Is this online? And are you using a blobstorage? If so the configuration could be bad of your blob.
It is indeed online, I have both the issue on my dev server and pre production server. Both use different azure blob storage
Then it is most likely something to have to do with the cache settings in your connectionstring.
To be 100% sure you could try running it locally, but I can almost guarantee it's a Blob connectionstring issue.
I remove the azure blob configuration from the appsetting and the .AddAzureBlobMediaFileSystem() from the ConfigureServices and all my images went broken (so far so good)
I added a new image via the back office of umbraco and tried again and... the new image is not cropped either :'(
I probably missed something somewhere
So I tried to change some configuration and nothing worked.
So I made a clean install of umbraco and literally copy/pasted the content of the Startup.cs file in my project and now the ImageSharp crops works like a charm.
It seems that I broke something with my modifications in the Startup.cs file, I will keep posted when I find what was the exact issue.
Thank you for your help guys
For anyone encountering the same issue, I used app.UseStaticFiles() which bypassed the ImageSharp crop and resize.
I removed the line in my Startup.cs Configure and it worked like a charm
Hah I was just searching about what that method does.. Glad you found it already!
To build on that for anyone else that encounters this.
Today I encountered the same thing (Umbraco 10.2.1.7). The problem is I can't remove app.UseStaticFiles() since that is needed for some other functionality.
When this happens you can simply bypass the /media/ folder by changing the configuration to:
Ooh that's a neat trick! Would you mind adding that as a comment to this thread as well please Rickard? 🙏
https://our.umbraco.com/forum/using-umbraco-and-getting-started/109573-getcropurl-doesnt-resize-the-image-on-umbraco-10
@Rickard Lövgren
This solved my issue! I had app.UseStaticFiles() in place to enable Blazor; switching it to this kept Blazor functioning but fixed ImageSharp.
Awesome, worked like a charm. Much, much obliged.
@Rickard Lövgren
Thanks for this solution, I've been pulling my hair out for hours over why the cropper was rendering images out at their native size in v10.
Cheers
Chris
I dont suppose anyone can tell me how to get the image cropper working using a virtual directory?
I can get the image cropper working using a local image, but images stored on our virtual directory "/media" dont seem to work.
Thanks
Hi All, I have found a potential other issue
If you have an image or images:
Looping and rendering:
There are no errors here. BUT the images DO NOT render the crop and only the full size.
This does not work (renders nothing):
If you want the format it only seems to work with:
is working on a reply...