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
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
May be this post will be helpful to you. And more links are available in this post for your reference.
1Resize Image in Photo Upload in Visualforce before save in attachment?
Thanks
Resize the image using third party application Then upload the image as static resource.