react-cloudinary icon indicating copy to clipboard operation
react-cloudinary copied to clipboard

Options doesn't work?

Open Pitbi opened this issue 9 years ago • 1 comments

Hello,

I try react-cloudinary, but I can not use options.

My code: <CloudinaryImage publicId={ picture.publicId } options={ { width: 300, height: 300 } } />

Url returned: http://res.cloudinary.com/CLOUDINARY_NAME/image/upload/PUBLIC_ID

The cloudinary name (configured with cloudinaryConfig) and the public id are correct. But i don't have any transformation.

Can you help me?

TY.

Pitbi avatar Oct 21 '16 15:10 Pitbi

Hi, @Pitbi, options does work.

But height and width properties doesn't work without specifying crop option. You can pass it directly in the component <CloudinaryImage publicId={ picture.publicId } options={ { width: 300, height: 300, crop: 'fit' } } />

Or specify in the global app config: import { cloudinaryConfig } from 'react-cloudinary'; cloudinaryConfig({ cloud_name: 'xxx', fetch_format: 'auto', crop: 'fit' });

You can specify another crop mode in the component, even if you specified the default one on the cloudinaryConfig

Read more about crop modes

goooseman avatar Jan 05 '17 11:01 goooseman