cloudinary icon indicating copy to clipboard operation
cloudinary copied to clipboard

How to use transformations with React

Open hyperh opened this issue 9 years ago • 4 comments

To get a transformed image, the docs say to do it like this: <img width="250" src="{{c.url public_id effect='blur:300' angle=10}}">

This uses the helper c. If I'm using React, how would I get a transformed image? I tried Cloudinary._helpers.url('public_id', {effect:'blur:300', angle:'10'}) But I only get http://res.cloudinary.com/dmwby0n3f/image/upload/public_id

hyperh avatar Mar 01 '16 10:03 hyperh

You're passing public_id as a string. Remove the ' (quotes) in public_id and it should work

Secretmapper avatar Mar 05 '16 10:03 Secretmapper

@hyperh did you get it to work, or is it actually an issue with this module and React? I could only retrieve the default image without any transformation, just like you explained.

osterkraft avatar Dec 15 '16 00:12 osterkraft

@osterkraft I'm no longer working on the project that used this library, so unfortunately I can't help you out. Best of luck.

hyperh avatar Dec 17 '16 22:12 hyperh

@osterkraft I tried it from my console and its working for me.

Nisthar avatar Mar 19 '17 14:03 Nisthar