Losing image orientation while converting an image to CGImage

后端 未结 7 2080
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-31 04:30

I\'m facing an image orientation issue when cropping a square portion of an image out of a rectangular original image. When image is in landscape, it\'s fine. But when it is

相关标签:
7条回答
  • 2020-12-31 05:23

    SWIFT 3:

    convert rotated cgImage to UIImage by this method

    UIImage(cgImage:croppedCGImage, scale:originalImage.scale, orientation:originalImage.imageOrientation)
    

    Source @David Berry answer

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