Options doesn't work?
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.
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