title: Rotating an image context (CGContextRotateCTM) causing it to become blank. Why?
body: <pre><code>#define radians(degrees) (degrees * M_PI/180)
  
  UIImage *rotate(UIImage *image) {
    CGSize size = image.size;;
  
    UIGraphicsBeginImageContext(size);
    CGContextRef context = UIGraphicsGetCurrentContext();
  
    // If this is commented out, image is returned as it is.
    CGContextRotateCTM (context, radians(90));
  
    [image drawInRect:CGRectMake(0, 0, size.width, size.height)];
    UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
  
    return newImage;
  }
  </code></pre>
  
  <p>Could something else be wrong? Out of ideas.</p>