Reputation: 11
I am having trouble with the following code;
//get a CIImage
UIImage *origImage = [UIImage imageNamed:imageName];
CIImage *inputImage = [[CIImage alloc] initWithImage:origImage];
NSLog(@"the inputImage is %@", imageName);
imageName is an NSString property, and always logs correctly. In my project, if I put a breakpoint just following the CIImage line, I get the UIImage, but not the CIImage. Also, I've noticed some of the uiimage properties look odd (scale always tiny, e.g. 0.0000002 and _imageFlags seems empty). I've recently built the code in a separate project, and it works fine (CIImage is created and can be used for CIFiltering etc), but not in this project. The only difference between the projects is the original (problematic) one had an OpenGLES implementation, whereas the new one just uses CoreImage. Also the old project was created from the iOS 6 SDK, the new one from the iOS 8 SDK. I've tried a few other methods of creating the CIImage (origimage.ciimage and via origimage.cgimage) but none work.
Any ideas appreciated.
Thanks, dunga.
Upvotes: 0
Views: 143
Reputation: 11
I have resolved the issue. The LLVM 6.0 Code Generation settings of the project, if any optimisation level was set (i.e. > none), then the CIImages failed to get assigned. Hence it worked in one project, but not the other.
Upvotes: 0