0

Short and simple, My captured image gets squeezed from both sides when loading it on the preview.

Long version: I am currently using the CameraManager Pod found at https://github.com/imaginary-cloud/CameraManager/blob/master/camera/CameraManager.swift. My problem is that after I take a picture, it squeezes the image a little bit on both sides. The width is not what I see. The bounds of my preview (what I see through the camera) is view.frame.bounds and my bounds of the imageView (what I just captured) is preview.frame.bounds. If need be, I can take a image of whats happening if you need more information.

If you need the code just comment and I can show you. Any feedback is greatly appreciated.

Bhavik P.
  • 905
  • 3
  • 10
  • 28

1 Answers1

1

The problem was that I wasn't setting the contentMode of my image view. All I had to do was add this line

imageView.contentMode = UIViewContentMode.ScaleAspectFill

Duplicate of:

How to manage UIImageView content mode?

and

capture image is stretched using avcapture session

Sorry for posting a question without doing thorough research. I wasn't Google-ing the right query.

Community
  • 1
  • 1
Bhavik P.
  • 905
  • 3
  • 10
  • 28