function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sagar PareekSagar Pareek 

Need to shrink image before upload.

Hi 

I have a requirement where i need to srhink image before uploading it as an attachment through a vf page.

How i can do this?

Vinita_SFDCVinita_SFDC

Hello,

 

As of now no image compression mechanism is provided by salesforce. As long as images are within the supported standard size and format, we can upload images.

 

I'd suggest you to either post an idea or vote a similar idea available on ideaexchange portal at below link:

 

https://success.salesforce.com/ideaView?id=08730000000jpbeAAA

sfdcfoxsfdcfox
If you're not concerned about alienating IE folk (IE9 and less), you could use HTML5's native capabilities to shrink your image. See http://stackoverflow.com/questions/2303690/resizing-an-image-in-an-html5-canvas as an example.
Ajinkya DhasAjinkya Dhas
If you want this functionality in salesforce Please UpVoted So that salesforce will implement it 
Thank You,
https://success.salesforce.com/ideaView?id=0873A000000cRJQQA2