If I have a (potentially largish) file on disk, and I want to determine quickly whether UIImage will be able to load it.
I don't necessarily trust the file extension to be reliable; I need to look at the actual data.
I can (of course) load it into a UIImage, but that's relatively slow and rather memory intensive. I'd rather just peek at the first chunk of the file and make a decision.
What's the fastest, most efficient way to go about this that is still fairly reliable? (Ideally, it'd be an Apple-provided API, but I didn't turn one up in my searches.) A 99.9% solution is good enough; I'm willing to have false positives in rare cases, such as when an image file has been truncated.