Swift 2.0 Xcode 7.1 image picker front camera image rotated when picked

前端 未结 1 812
夕颜
夕颜 2021-01-07 09:43

I have a tableview that displays people with an imageview and label. When a person is inserted into the table it can pull from contacts and the images look fine. When a pers

1条回答
  •  借酒劲吻你
    2021-01-07 10:21

    Swap out the UIImagePNGRepresentation and use UIImageJPEGRepresentation instead. PNGs aren't saved with orientation information automatically. Unless you are doing a photo specific app where photo quality has to be perfect, JPGs are fine.

    The UIImageJPEGRepresentation will ask for the image data but also a CGFloat to set the compression quality. It's from 0.0 to 1.0 (best).

    Good Luck!

    0 讨论(0)
提交回复
热议问题