I\'m facing a weird problem. I\'m developing an iOS command line barcode scanner utility using libzbar (yes, this is for jailbroken devices). All goes fine except when I\'m
when using a filename, the sample code from the apple documentation uses a combination of what you had mentioned trying in your comments, plus the value kCGRenderingIntentPerceptual
rather than the default:
CGDataProviderRef pngDP = CGDataProviderCreateWithFilename([filePath fileSystemRepresentation]);
if (pngDP) {
CGImageRef img = CGImageCreateWithPNGDataProvider(pngDP, NULL, true, kCGRenderingIntentPerceptual); // true for interpolate, false for not-interpolate
doing this should keep you from having to keep the data itself in your program, and may prevent the segfault you're seeing.
(at the very least, perhaps get and try the sample code for CoreTextPageViewer found in the official iOS documentation, build that project, and try to figure out how what you're doing differs.)