react-img-mapper icon indicating copy to clipboard operation
react-img-mapper copied to clipboard

Image with object-fit and object-position

Open zatakiya opened this issue 10 months ago • 1 comments

Thanks for the awesome library.

New to this library and finding it hard to make this library work with image where object-fit and object-position is used. I have a case where container's aspect ratio is different than image's intrinsic aspect ratio. So I need to set following properties on image

object-fit: cover; object-position: center; overflow: hidden;

zatakiya avatar Feb 15 '25 07:02 zatakiya

Hello @zatakiya

In that case, you can use the img-mapper-img class name or you can use imgProps.style ( https://github.com/img-mapper/react-img-mapper/blob/master/src/ImageMapper.tsx#L310-L314 )

Check doc: https://github.com/img-mapper/react-img-mapper?tab=readme-ov-file#properties ( imgProps )

NishargShah avatar Feb 15 '25 13:02 NishargShah

Since there’s been no response from the OP for the past two months, I’m closing this issue due to lack of discussion from the OP side.

NishargShah avatar Oct 06 '25 21:10 NishargShah