I just want to compress the images on upload during a form/controller upload process using HttpPostedFileBase. Not all images cached, nor all uploads from backoffice.
For the suggestion above by Phil Whittaker, could someone post an example as the docs are out of date and the instructions do not work.
Resize and compress image during upload in the media section
Hi all,
is it possible to resize and compress an image during the upload in the media section?
Can I use the image processor to do this in c# code during the media saving event or.. ?
Another requirement is that this resizing and compressing is only done when an image is uploaded to a certain folder.
Kind regards,
/Michaël
Hi
Yes you can use the media saving event and create a new image from here.
Alternatively you could do the image process on the front end using image processor and "remote.axd", then you wouldn't be tied to code.
Or you could set up an image cropper data type on your content and define the sizes there.
Phil
Any details or links as to how to do this?
Cheers
Hi Damien,
Have a look at James' (author of ImageProcessor) post on 24 Days In Umbraco here: https://24days.in/umbraco-cms/2014/all-your-images-are-belong-to-umbraco/
It explains how to pre-process images if you need to.
Hope that helps,
/Chriztian
Yep, I looked at that one already, unfortunately it does not seem to be working.
It processes but does not seem to save the file.
If you are using Umbraco 7 then you can set crop sizes on any uploaded images - https://our.umbraco.org/Documentation/Getting-Started/Backoffice/Property-Editors/Built-in-Property-Editors/Image-Cropper
If you want images compressed automatically I'd recommend installing http://imageprocessor.org/imageprocessor-web/plugins/postprocessor/ - it will recompress all images cached by imageprocessor.
I just want to compress the images on upload during a form/controller upload process using
HttpPostedFileBase
. Not all images cached, nor all uploads from backoffice.For the suggestion above by Phil Whittaker, could someone post an example as the docs are out of date and the instructions do not work.
is working on a reply...