ios - When applying a filter to a UIImage the result is upside down -


This really makes me angry when I change a CIImage a UIImage am, then apply a filter, then Change the image from top to bottom (for landscape) or rotated anticlockwise 90 degrees (for portrait).

  var Image: UIImage? Var Index: Int? @IBOutlet Weak Var Photo: UIImageView! @IBAction func editImage (Sender: UIBarButtonItem) {println ( "editImage") go IIMAGE = CIImage (Image: self.image) filter = CIFilter (name: "CISepiaTone") filter.setValue (startImage, forKey: kCIInputImageKey) Filter . SetValue (0.8, forKey: kCIInputIntensityKey) to Niaimej = UIImage to (Siaimaj filter. Output Image) Selfkfoto. Image = new Image}  

image filtered image orientation and scale back on the original values set up:

  Let NewImage = UIImage (CIImage: filter.outputImage, scale: self .image.scale, Orientation: self.image.imageOrientation)  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -