Post

Replies

Boosts

Views

Activity

How to get thumbnail / preview image for items imported from PHPicker?
I am starting to use NSItemProvider methods hasRepresentationConforming and loadFileRepresentation for importing images, live photos and videos from PHPicker on iOS. I would like to generate thumbnails / preview images for each imported image, live photo and video. I tried using theNSItemProvider method loadPreviewImage, but in testing with Xcode Version 12.0 (12A7209) in iOS 14 Simulator, the NSItemProvider.CompletionHandler always returns nil for the item regardless of whether I use NSData, NSURL or UIImage. Is it best to generate thumbnails by scaling down imported images with UIGraphicsBeginImageContext and use AVAssetImageGenerator on imported videos?
3
2
3.4k
Oct ’20