开发者

What format is person's ImageData(CFDataRef) in AddressBook?(Jpeg or PNG)?Or how to determine?

开发者 https://www.devze.com 2023-03-30 17:12 出处:网络
From AddressBook\'s API ABPersonCopyImageData I can get a CFDateRef which is toll-free bridge to NSData. And I want to write this data开发者_StackOverflow社区 to file, but what file extension should I

From AddressBook's API ABPersonCopyImageData I can get a CFDateRef which is toll-free bridge to NSData. And I want to write this data开发者_StackOverflow社区 to file, but what file extension should I use ? .jpeg or .png?

The documentation doesn't mention what the data is.Is there any way to know?


NSData  *imgData = (__bridge NSData *)ABPersonCopyImageData(person);
        UIImage *img = [UIImage imageWithData:imgData];
        if (!img) {
            img = [UIImage imageNamed:@"noImage.png"];
        }
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号