This gives me a crop from a named crop definition. But what if i just want the image to be 300 pixels wide? or if i want a 300x300 image?
its described in the docs, but unfortunately not clear enough for me to get it...
I would caution against nesting GetPropertyValues within other calls just because if they are null - you are going to get errors within your code.
the above passes everything to the handler, so it can deal with things when you don't have values set. but just to be sure i personally would wrap this with a check
if (Model.Content.HasProperty("billede") && Model.Content.HasValue("billeded") )
then i know i have a value - and its set to something.
simple fixed width crop with imagecropper
Ok, this should be simple, but i cant figure it out, and i think the docs are lacking on specifics.
Im trying to do simple image resizing using the cropper, so i just want an image from the cropper, that has a fixed width, eg. 300 pixels.
This gives me a crop from a named crop definition. But what if i just want the image to be 300 pixels wide? or if i want a 300x300 image? its described in the docs, but unfortunately not clear enough for me to get it...
https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/image-cropper
Any help?
Hi Claushingebjerg You could just do it yourself like this:
I hope this helps.
Kind regards
Paul
Hi
based on teh documentation (assuming you are using Umbraco 7.3.5 or greater)
you want
I would caution against nesting GetPropertyValues within other calls just because if they are null - you are going to get errors within your code.
the above passes everything to the handler, so it can deal with things when you don't have values set. but just to be sure i personally would wrap this with a check
then i know i have a value - and its set to something.
is working on a reply...