Closed scriptPilot closed 1 year ago
The CNContactStore
in Swift provides the following two image types:
CNContactImageDataKey
and CNContactThumbnailImageDataKey
.
Currently it's returning the value belonging to the CNContactImageDataKey
. I'm not sure if the CNContactThumbnailImageDataKey
would return a 'cropped' variant. It would return a thumbnail though. So I'm not sure if that is desirable. What do you think?
If you have access to Xcode, you could easily test the difference between to two by the way. Just navigate to the source code and swap:
CNContactImageDataKey
with CNContactThumbnailImageDataKey
contact.imageData
with contact.thumbnailImageData
@tafelnl - Thanks a lot for that proposal. I've just tested it and the images are still returned full, not cropped, but in poorer quality. So this proposal does not solve the initial problem unfortunately.
In that case I am afraid it's not possibly to do what you want. Because Apple does not offer any other thing in their CNContact
API that I know of
Ok - thanks for looking into it.
No worries
Describe the bug When adding a contact photo via iOS Contacts and crop the face from a large image, the large image is retrieved not only the cropped face as expected.
To Reproduce Steps to reproduce the behavior:
Expected behavior Cropped image / face retrieved as base64 string.
Screenshots n/a
Smartphone (please complete the following information):
Additional context