I'm using Umbraco version 7.5.9 and I have some difficulties using predefined crops with crop mode other than "Crop".
I'd like to use predefined crop size with crop mode "Max".
Many of the crop modes keep the image's aspect ratio and only change the dimension of either height OR width, so it doesn't make sense to specify the exact size for both - they are dynamically calculated at runtime.
But if you look at the max documentation, you will see you can specify both, so WURMi seems to be right to assume that there is a bug using the cropalias together with something else than crop
Resize Max
Resizes the image to the given dimensions. If the set dimensions do not match the aspect ratio of the original image then the output is resized to the maximum possible value in each direction while aintaining the original aspect ratio.
What happens if you put the height and width parameters in the generated url? Do you get the image in the correct format then? If so, maybe make a bug/feature report on the issue tracker
Yes, it work like described in documentation => the image is resized to the maximum possible dimensions in consideration of aspect ratio. So I will create a bug report on the issue tracker. Thanks for confirmation of my assumption ;)
One of the greatest challenges that come with creating a responsive, mobile-friendly site is to adapt your images for various smaller resolutions so that they're not the bandwidth-eating monsters you normally get on a desktop resolution.
GetCropUrl with imageCropMode
Hello,
I'm using Umbraco version 7.5.9 and I have some difficulties using predefined crops with crop mode other than "Crop". I'd like to use predefined crop size with crop mode "Max".
Let me write some samples:
this work and return string is:
/media/1115/u300981_medium.jpg?anchor=center&mode=crop&width=160&height=90&rnd=131349260720000000
if I add some custom attributes like 'quality', it work as well:
/media/1115/u300981_medium.jpg?anchor=center&mode=crop&quality=50&width=160&height=90&rnd=131349260720000000
but why if I add imageCropMode with something other than 'Crop' width and height attributes disappears???
/media/1115/u300981_medium.jpg?mode=max&quality=50&rnd=131349260720000000
I spend couple of hours trying to understand if this is a some special feature or bug, but more and more I think it's a bug ;-/
Thanks,
Marek
The Umbraco image cropper actually utilises Image Processor in the background - the docs for resize modes are here - http://imageprocessor.org/imageprocessor-web/imageprocessingmodule/resize/
Many of the crop modes keep the image's aspect ratio and only change the dimension of either height OR width, so it doesn't make sense to specify the exact size for both - they are dynamically calculated at runtime.
That link goes to a russian site. Feels unsafe.
The author let it expire some time in 2023. It's been obsolete for a long time. I used the Wayback Machine to pull some information recently: https://web.archive.org/web/20230324134858/https://imageprocessor.org/
But if you look at the max documentation, you will see you can specify both, so WURMi seems to be right to assume that there is a bug using the cropalias together with something else than crop
You're right Sven. This is exactly what I need to achieve. Using both dimensions (defined in crop alias) together with crop mode Resize Max
What happens if you put the height and width parameters in the generated url? Do you get the image in the correct format then? If so, maybe make a bug/feature report on the issue tracker
Yes, it work like described in documentation => the image is resized to the maximum possible dimensions in consideration of aspect ratio. So I will create a bug report on the issue tracker. Thanks for confirmation of my assumption ;)
I know this is old but was this ever fixed Im still seeing the same issue and googling only ever brings up this question.
I'm still seeing this issue 4 years later in 2021.
Bug reported: https://github.com/umbraco/Umbraco-CMS/issues/9971
One of the greatest challenges that come with creating a responsive, mobile-friendly site is to adapt your images for various smaller resolutions so that they're not the bandwidth-eating monsters you normally get on a desktop resolution.
is working on a reply...