
引用:
#import <ImageIO/ImageIO.h>
代码:
NSString* path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"back-btn.png"];
NSURL* imageFileURL = [NSURL fileURLWithPath:path];
CGImageSourceRef imageSource = CGImageSourceCreateWithURL((__bridge CFURLRef)imageFileURL, NULL);
if(imageSource) {
NSDictionary* options = @{(NSString*)kCGImageSourceShouldCache:@NO};
CFDictionaryRef imageProperties = CGImageSourceCopyPropertiesAtIndex(imageSource, 0, (__bridge CFDictionaryRef)options);
if(imageProperties) {
NSLog( @"properties: %@", imageProperties);
CFRelease(imageProperties);
}
} else{
NSLog(@" Error loading image");
}