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

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -