How do you get a person's image from an iPhone address book?
To get photos into contact, open Contacts, go to the contact and click Edit, then add a photo. Is this Messages in iOS or osX? Go to Settings>Messages>Show Contact Photos.
In the Information pane, click Faces to open the Faces section. In the photo, an “unnamed” label appears under detected faces. If the face you want has been detected, click the label and type a name. If no label appears, the face hasn't been detected.
Open the Contacts app and select the contact. In the contact's information, tap on Edit from the top-right corner. Tap on Add Photo or Edit Photo. Select the Camera icon to click a picture or All Photos for an image from the library.
Instead, open Google Contacts, select the person, select the profile images in the circle to open it up full screen, and then take a screen shot to save to device. Typically on Android, you simultaneously hold down the power button and the volume down key to take a screen shot.
You can do it like this....
NSData *imgData = (NSData *)ABPersonCopyImageData(person);
UIImage *img = [UIImage imageWithData:imgData];
where person
is of type ABRecordRef
. Now, as CFData and NSData are toll-free bridged, you can simply type cast CFData
to NSData
and get the image
Hope this helps.
(NSData*)ABPersonCopyImageDataWithFormat([targetPeople objectAtIndex:index], kABPersonImageFormatThumbnail)
This is faster since it returns a thumbnail.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With