title: iOS 10: CIKernel's ROI function did not allow tiling
body: <p>In my iPhone app, I've always used the following function to <code>horizontally mirror</code> an image.</p>
  
  <pre><code>-(UIImage*)mirrorImage:(UIImage*)img
  {
      CIImage *coreImage = [CIImage imageWithCGImage:img.CGImage];
      coreImage = [coreImage imageByApplyingTransform:CGAffineTransformMakeScale(-1, 1)];
      img = [UIImage imageWithCIImage:coreImage scale:img.scale orientation:UIImageOrientationUp];
      return img;
  }
  </code></pre>
  
  <p>With iOS 10.0.1 though, this function still runs with no errors, but when I try to use the <code>UIImage</code> from this function, the following warning appears, and the image just doesn't seem to be there.</p>
  
  <pre><code>Failed to render 921600 pixels because a CIKernel's ROI function did not allow tiling.
  </code></pre>
  
  <p>This error actually appears in the Output window when I attempt to <em>use</em> the <code>UIImage</code> (in the second line in this code) :</p>
  
  <pre><code>UIImage* flippedImage = [self mirrorImage:originalImage];    
  UIImageView* photo = [[UIImageView alloc] initWithImage:flippedImage];
  </code></pre>
  
  <p>After calling <code>mirrorImage</code>, the <code>flippedImage</code> variable <em>does</em> contain a value, it's not <code>nil</code>, but when I try to use the image, I get that error message.</p>
  
  <p>If I were to <em>not call</em> the <code>mirrorImage</code> function, then the code works fine:</p>
  
  <pre><code>UIImageView* photo = [[UIImageView alloc] initWithImage:originalImage];
  </code></pre>
  
  <p>Is there some new quirk with <code>iOS 10</code> which would prevent my <code>mirrorImage</code> function from working ?</p>
  
  <p>Just to add, in the <code>mirrorImage</code> function, I tried testing the size of the image before and after the transformation (as the error is complaining about having to <code>tile</code> the image), and the size is identical.</p>