react-image-magnify icon indicating copy to clipboard operation
react-image-magnify copied to clipboard

How to keep the largeImage aspect ratio same as original.

Open ehaanfaaz opened this issue 4 years ago • 4 comments

I want to keep the aspect ratio of different images to their original aspect ration.

<ReactImageMagnify {...{ smallImage: { alt: 'Wristwatch by Ted Baker London', isFluidWidth: true, src: this.state.currentImage.fluid.src, sizes: '(max-width: 480px) 100vw, (max-width: 1200px) 30vw, 360px', srcSet: this.state.currentImage.fluid.srcSet }, largeImage: { src: this.state.currentImage.fluid.src, srcSet: this.state.currentImage.fluid.srcSet, width: 600, height: 800 }, isHintEnabled: true, shouldHideHintAfterFirstActivation: false }} />

ehaanfaaz avatar Mar 16 '20 07:03 ehaanfaaz

I have same problem

nuanyang233 avatar Aug 27 '20 02:08 nuanyang233

same problem here!

ghost avatar Nov 07 '20 08:11 ghost

same problem!

AdamJSoftware avatar Dec 19 '20 20:12 AdamJSoftware

You can try this:

  enlargedImageStyle: {
    objectFit: 'contain',
  },

Spaider15 avatar Sep 28 '21 13:09 Spaider15