smeevil / cloudex

An elixir library which helps with uploading image files or urls to cloudinary
Do What The F*ck You Want To Public License
104 stars 65 forks source link

Using eager transformations in image upload. #52

Open radglob opened 5 years ago

radglob commented 5 years ago

I haven't been able to upload images using eager transformations. For my application, I just want to resize images to a certain width by default. Cloudinary seems to support this, and while I understand how to fetch images with certain dimensions using Cloudex.URL.for, I haven't been able to get resizing to work on upload.

I might be missing something obvious.

ClementineOldfield commented 4 years ago

I realise this is quite an old issue but this had me stuck for a while tonight. I've created a pull request that adds :eager to the UploadedImage struct, this should allow you to access the eagerly transformed images.

It's also important to use the Rest API syntax for the transform properties: "c_crop,w_500,h_500,g_face" instead of a map or keyword list as per some of the Cloudinary SDKs.