Directly access UIImage 's CGImage property may result undesired result.
Because UIImage may come from CIImage, if that's the case, then self.CGImage is nil.
We can add a check, if self.CGImage is nil, then create a CGImage from it's backing CIImage.
Directly access UIImage 's CGImage property may result undesired result. Because UIImage may come from CIImage, if that's the case, then self.CGImage is nil. We can add a check, if self.CGImage is nil, then create a CGImage from it's backing CIImage.