[SalesForce] Reducing size of the image when uploading in salesforce attachment

I have requirement where when images are uploaded in salesforce attachment, the image size or resolution should decrease.So that salesforce won't be overloaded. Can anybody help me out with any approach.

Regards

Best Answer

Unfortunately Apex does not have any native method of reducing the image size (or any other image transformations).

However, I have just solved the same problem :). I used javascript to change the size of the image in the browser before uploading it to Salesforce. This will work with all modern browsers. I haven't checked if it will work for older browsers.

We use this javascript: https://github.com/viliusle/Hermite-resize

Related Topic