CGDataProviderCopyData modifies original image

Originator:google+
Number:rdar://15195959 Date Originated:10-Oct-2013
Status:Open Resolved:
Product:iOS SDK Product Version:7.0.2 (11A501)
Classification:Other BUg Reproducible:Always
 
Summary:
Calling CGDataProviderCopyData(CGImageGetDataProvider(image.CGImage)) modifies the original image, the R and B channels seem to be switched.

Steps to Reproduce:
1) Load an image with -[UIImage imageNamed:]
2) Assign the image to an image view
3) use CGDataProviderCopyData(CGImageGetDataProvider(image.CGImage)) to copy the image data

---
    UIImage *image = [UIImage imageNamed:@"testImage"];
    self.imageView.image = image;
    CFDataRef dataSource = CGDataProviderCopyData(CGImageGetDataProvider(image.CGImage));
    CFRelease(dataSource);
---

Expected Results:
The original image doesn't change, dataSource contains image data.
The image view displays the original image correctly.


Actual Results:
The image view displays the original image as if R and B channels are switched.

Version:
7.0.2 (11A501)

Notes:
Sample project: https://github.com/toco/radars/tree/master/CGDataProviderCopyData-Bug

Configuration:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!