How to control the picture without distortion by css

Mini Program"s requirement is to make the data of the img passed by the background undistorted, but the design gives the effect of 70 times 70. the size of the img passed in the background may be 100x200,80,120and so on. Is there any solution that can solve the problem that the pictures that pass through are not deformed? in the corresponding 70mm 70 container, or how to cut only the avatar part is OK. I tried the properties in the mode of image, but all of them are not satisfactory. If you have done it, please give me some advice. Thank you.


the current solution is to define widthFix in the mode property of image to keep the aspect ratio of the original image unchanged, and then nest a tag on the outside given width and height to add overflow: hidden; so that the upper part


can be displayed.
  

first of all, I would like to say that there is no restriction when you upload a picture. No matter how you change it, there will always be another part of the picture that will look inconsistent.
but I write the picture to judge the aspect ratio of the picture, and then press the smaller 100%, the other auto.
I upload a picture of 1000px*1px, what to do, right? so finally emphasize a game, let them follow the rules when uploading pictures, otherwise how can any pictures not be deformed? You write the code yourself and give them a rule,

Menu