material-ui-image icon indicating copy to clipboard operation
material-ui-image copied to clipboard

There should be an prop option to whether to stretch the image or not.

Open BhushanDangore opened this issue 6 years ago • 2 comments

Currently, the image gets stretched regardless of the aspect ratio of the images. There was an issue regarding this but that one is closed now because according to them we can't determine the aspect ratio of the image which is not even loaded and that is correct #26. But I think what we can do is rather than determining the width and height of the container we should shrink the image so that it will fit into that container. Currently, the image is using 100% width and height therefore it is stretching. if we change it to max-width and max-height the image gets fitted within the container without stretching. (Centering of the image also need to be done) Annotation 2020-03-21 121355

BhushanDangore avatar Mar 21 '20 06:03 BhushanDangore

@BhushanDangore this can be achieved by adding imageStyle={{objectFit: "cover"}}

Cubxity avatar Sep 26 '20 16:09 Cubxity

Thanks for the PR, @Cubxity :+1: I'll publish a new version.

leMaik avatar Oct 07 '20 15:10 leMaik