Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resize the image before uploading to cloudinary?

This is my first time to post a question here. I was building a meteor app with image uploading functions. I found a cloudinary package for meteor https://github.com/Lepozepo/cloudinary and it works pretty well. The only and the biggest problem I have is the resizing of image. By default this package will upload the original image taken from phone, which is often 3 or 4 MB and whose size is around 2000x4000, but I only want image to a few KBs. And because of this problem, it takes so much storage and bandwidth for the app. What should I do to fix this problem ? Thank you very much.

like image 815
Tao Liu Avatar asked Oct 24 '25 17:10

Tao Liu


1 Answers

I am not sure if anybody needs this but i was struggling with this for the past 2 days and could not find a solution. Finally i went to cloudinary dashboard and it was the simplest thing ever. Login to your cloudinary. Go to settings -> upload -> Upload presets: edit(on your project) -> upload manipulations -> Incoming Transformation: edit -> change the imcoming image as you like :D.

I uploaded an image 2mb in size and it came down to 30kb after applying incoming transformation.

Hope this helps someone :)

like image 56
Raj Avatar answered Oct 26 '25 09:10

Raj



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!