How to deal with the stretching and distortion of image