Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hello!

Is there a way to compress images file size when uploading?
My client will probably be uploading photos right from his phone (probably over 2mo photos).
To make sure it doesn't take forever to load the page, is there a way to compress the image on upload to make sure the page doesn't get flooded with super large files images?

Thank you!
Hi,

I suppose you are using the type 'image' editable region for the uploads.
You may use the 'width', 'height' and 'enforce_max' parameters of the tag to automatically resize the uploaded images to the specified values (thus reducing their size).

For example, the following will resize any images over 1000px X 1000px to make them fit within the constrained dimensions -
Code: Select all
<cms:editable type='image' name='test_img' width='1000' height='1000' enforce_max='1' />

If the uploaded images are really large, you'll have to make sure your server has sufficient memory to process the resize procedure.

Hope it helps.
Thanks KK! That did the trick
3 posts Page 1 of 1