views:

48

answers:

2

I'm currently using writeImageToSavedPhotosAlbum:orientation:completionBlock: and it is taking a little over 3 seconds to write an image to the Photos album ... whereas the standard Camera app seems to persist images much faster.

So, what is the fastest way to write files to the default Photos album?

I'm not sure what all my options are and the pros/cons of each. Any help would be appreciated.

Thanks -wg

+1  A: 

Dont save them to the camera album first. I dont think there is a faster way to write to the iPhone camera library. but you can save them to your own application space or leave them in memory so and try and write in the background.

John Ballinger
I essentially combined your idea with alones ... writing to documents directory and then adding NSOperations to an NSOperationQueue to actually move the saved images to the Photos album using ALAssetsLibrary. So far ... so good. As a side note, I did have to set the NSOperationQueue's setMaxConcurrentOperationCount = 1 and also toggle the "suspended" state of the queue when writing to the Photos album as that itself is an async operation. So, I essentially add an operation, set queue.suspended = YES, in operation write to Photos album and in its completion handler set suspeneded=NO.
wgpubs
Hi, great to see you found a nice way to make it work. The biggest thing I hate about apps is when they block the UI, so you have to what for some abstract operation to complete. For me the non blocking UI is what makes some apps really nice to use. Glad my answer helped.
John Ballinger
+1  A: 

Further, you can do saving photos in parallel using NSOperation. And like John, remained jobs can be done in background.

alones