photosframework

Get the local file path of a PHAsset

泪湿孤枕 提交于 2019-12-10 00:47:59
问题 I have a photo I want my user to be able to share on Instagram and I need to get the local file directory of the photo. However I am fetching my images as a PHAsset (not the ALAsset all the other answers seem to cover on this subject). Looking at the PHAsset documentation I don't see a 'local directory' variable. Do you know how I can get the path to a photo from the users camera roll using the new ios8 Photo's framework? Here is my code for loading the last image in the users photo roll

Photos Framework requestImageDataForAsset occasionally fails

南笙酒味 提交于 2019-12-08 22:58:30
问题 I'm using the photos framework on iOS8.1 and requesting the image data for the asset using requestImageDataForAsset... Most of the time it works and I get the image data and a dictionary containing what you see below. But sometimes the call completes, but the data is nil and the dictionary contains three generic looking entries. The calls are performed sequentially and on the same thread. It is not specific to any particular image. The error will happen on images I've successfully opened in

iCloud sync of images in Photos Framework created album

て烟熏妆下的殇ゞ 提交于 2019-12-08 01:10:17
问题 TL;DR - Will an album created with [PHAssetCollectionChangeRequest creationRequestForAssetCollectionWithTitle:@"ALBUM_TITLE"]; sync over iCloud? And will synced images have the same localIdentifier on every device ? In my App I need to store a number of distinct albums/folders of photos that the user adds by either using the camera or adding an existing photo from the photo library. Ideally what I want is all the photos from the app to be located in the same one (specific to my app) album in

Crash when toggling access to Camera and Photos [duplicate]

落花浮王杯 提交于 2019-12-07 14:32:48
问题 This question already has answers here : App crashed in iOS 6 when user changes Contacts access permissions (2 answers) Closed 4 years ago . I have a collection view (standard flow layout) where the first cell is displaying a live camera feed, and the rest of the cells are displaying photos from the user's library using iOS 8's new Photos Framework. Everything renders and works great. When opening for the first time, I'm prompted for access to the Camera and to the Photos library, as expected

Accessing iCloud photos uniquely on multiple devices using PHAsset

二次信任 提交于 2019-12-07 11:14:47
问题 Is there a way of accessing a specific PHAsset in an iCloud album uniquely on multiple devices? I have written a simple app that lists thumbnails and .localIdentifier s from an iCloud shared album, and (naturally) it shows the same images on different devices, however, the localIdentifiers are different for the same images on different devices (not so unexpected as it is a "local" identifier). However, what I actually want to do is associate a record in a cloud-shared CoreData database with

iCloud sync of images in Photos Framework created album

筅森魡賤 提交于 2019-12-06 10:01:25
TL;DR - Will an album created with [PHAssetCollectionChangeRequest creationRequestForAssetCollectionWithTitle:@"ALBUM_TITLE"]; sync over iCloud? And will synced images have the same localIdentifier on every device ? In my App I need to store a number of distinct albums/folders of photos that the user adds by either using the camera or adding an existing photo from the photo library. Ideally what I want is all the photos from the app to be located in the same one (specific to my app) album in the Photos app, for this album to sync over iCloud, and for me to be able to store references to the

How to retrieve photo extension (jpg/png) in iOS 8.0 using Photos API?

百般思念 提交于 2019-12-06 04:27:56
问题 Am trying to get file extension of photos using the new Photos API in iOS 8 but haven't found a way to do so until now. Before iOS 8.0 I would use ALAssetRepresentation to get the file extension like: // Get asset representation from asset ALAssetRepresentation *assetRepresentation = [asset defaultRepresentation]; // Extract file extension from the original file name NSString* fileExt = [[assetRepresentation filename] pathExtension]; Is there any way to get file extension of photos now? PS: I

deleting a camera roll asset using Photos framework

半腔热情 提交于 2019-12-06 02:34:09
问题 I'm writing a test application to see if it is possible to delete a "photo library" asset in iOS 8, using the Photos framework. Although I suspect it is not possible, I find the documentation to be unclear, and there are posts on this site that seem to indicate it is possible. See here for example. In my test app, I pick an asset from the library: var picker = UIImagePickerController() picker.sourceType = UIImagePickerControllerSourceType.PhotoLibrary picker.mediaTypes = [kUTTypeMovie] In the

Crash upon CGImageDestinationFinalize

泄露秘密 提交于 2019-12-05 01:17:36
My app allows users to edit photos using the Photos framework. I am seeing some crash reports, and it appears the crash occurs when generating the output image, but I am not sure where the problem lies. This crash is occurring on multiple hardware devices and multiple versions of iOS 9 including the latest 9.1. The last call my app makes is CGImageDestinationFinalize in order to create the edited image NSData . The crash reports show that calls continue in the CoreImage space before the crash occurs in what appears to be GLTextureManager. Could this an out of memory issue? Do you see the issue

iPhone : Photos framework : how to get only those album/images which created by my app only not by others?

做~自己de王妃 提交于 2019-12-04 15:57:01
问题 I am creating a application like photos app. My application creates albums and captures images and saves them in albums in photos app. For this I am using Photos framework. When i am fetching albums it gives me albums which created by my app as well as other apps. So I want only those album/images which created by my app only not by other apps. 回答1: There is no straight-forward way to do this. But this is a workaround. PHFetchResult *topLevelUserCollections = [PHCollectionList