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
We have an umbraco 8 setup and are using the wonderful image cropper. That allows us to have images with fixed width and height.
But when creating articles we need to use images with all kinds of aspect ratios.
E.g a narrow image:
Or a very tall image:
None of these match any of our predefined crops.
We still want to be able to define the widt, but the height should be flexible.
How do we achieve that?
Thanks.
Hi Morten,
it depends a bit on if you also want to crop or resize.
you can add the width / height to the URL of the image, and image processor will resize maintaing the ratio.
e.g (on the image you uploaded) https://our.umbraco.com/media/upload/7eea9fe5-6727-4bc5-9e4f-672c9b832dee/400x100.jpg?width=200
cropping is more like what Umbraco does built in, and while you don't both width or height it doesn't do much beyond resize without both.
e.g https://our.umbraco.com/media/upload/7eea9fe5-6727-4bc5-9e4f-672c9b832dee/400x100.jpg?mode=crop&height=110
Thanks Kevin.
Great to see that we can set the width with ?width=xxx
I can also see that the file is compressed on the server as this 300px wide image is 4.89 KB.
https://our.umbraco.com/media/upload/7eea9fe5-6727-4bc5-9e4f-672c9b832dee/400x100.jpg?width=300
And this 1200px wide image is 28.6 KB
https://our.umbraco.com/media/upload/7eea9fe5-6727-4bc5-9e4f-672c9b832dee/400x100.jpg?width=1200
But how do we add this as an option i the backend?
If i define a crop with a width an no height I can not save it.
And from the image option I have to chose a crop, no "Free form" is available?
So I do i make the option available to the user?
Hi Morton,
I don't think you can do that via the back office :( , They would have to upload the image to the shape they want - and you then define the width in the code.
What about
<img src=”@Img.getCropUrl(’width: 820, imageCropMode: ImageCropMode.Max’)” />
??
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to insert an image that with fixed witdh, but any height?
We have an umbraco 8 setup and are using the wonderful image cropper. That allows us to have images with fixed width and height.
But when creating articles we need to use images with all kinds of aspect ratios.
E.g a narrow image:
Or a very tall image:
None of these match any of our predefined crops.
We still want to be able to define the widt, but the height should be flexible.
How do we achieve that?
Thanks.
Hi Morten,
it depends a bit on if you also want to crop or resize.
you can add the width / height to the URL of the image, and image processor will resize maintaing the ratio.
e.g (on the image you uploaded) https://our.umbraco.com/media/upload/7eea9fe5-6727-4bc5-9e4f-672c9b832dee/400x100.jpg?width=200
cropping is more like what Umbraco does built in, and while you don't both width or height it doesn't do much beyond resize without both.
e.g https://our.umbraco.com/media/upload/7eea9fe5-6727-4bc5-9e4f-672c9b832dee/400x100.jpg?mode=crop&height=110
Thanks Kevin.
Great to see that we can set the width with ?width=xxx
I can also see that the file is compressed on the server as this 300px wide image is 4.89 KB.
https://our.umbraco.com/media/upload/7eea9fe5-6727-4bc5-9e4f-672c9b832dee/400x100.jpg?width=300
And this 1200px wide image is 28.6 KB
https://our.umbraco.com/media/upload/7eea9fe5-6727-4bc5-9e4f-672c9b832dee/400x100.jpg?width=1200
But how do we add this as an option i the backend?
If i define a crop with a width an no height I can not save it.
And from the image option I have to chose a crop, no "Free form" is available?
So I do i make the option available to the user?
Hi Morton,
I don't think you can do that via the back office :( , They would have to upload the image to the shape they want - and you then define the width in the code.
What about
??
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.