views:

533

answers:

3

Hello everyone. So far I've managed to create an app for iPhone that takes multiple images with about a 3 second interval between each. I`m processing each image in a separate thread asynchronously and everything is great till it gets to the moment for saving the image on the iPhone disk. Then it takes about 12 seconds to save the image to the disk using JPEG representation.

How does Apple do it, how do they manage to save a single image so fast to the disk is there a trick they are using? I saw that the animations distract the user for a while, but still the time needed is below 12 seconds!

Thanks in advance.

A: 

If you google around a bit... there is a whole bunch of people with the same problem.

I didn't find an answer. The general conclusion seems to be that apple either uses some internal api and bypass public api overhead or some hardware encoder.

Guess you are out of luck for fast image saving

jitter
That`s what I`m afraid of. I also think that there is some internal API that Apple makes use of, but why aren`t we suppose to use it. Is there another way to speed my saving besides using JPEG or PNG representation and NSData, maybe OpenGL or something?
worriorbg
+2  A: 

I haven't tried this but I wouldn't be so sure that Apple isn't using the same methods. A big part of the Apple design philosophy relies on hiding operational interruptions from the user. The Apple code may take as much time as yours but simply be adroit at hiding the entire save time from the perception of the user.

If someone can't tell you how Apple actually does save faster I would suggest looking at ways to disguise the save time.

TechZen
I know that Apple is hiding the save process with an animation but still, if you take a picture with their default camera app and then at the same time hit the home button to close the app, the process takes less then 12 seconds and the image is in the camera roll. For me this means that the saving part passes quicker that it would by the methods I know. That`s how i know that there is some other way to do that besides hiding the saving process.
worriorbg
Just because a thumbnail shows up in the camera roll doesn't mean that the file has been completely saved. Apple may just create and display the thumbnail first while the file continues to save in the background. Unless you can actually watch the file on disk being created and closed, you don't know how long Apple is taking to carry out the file process. Trying to figure out how long the Apple operation takes based on clues from the interface is very unreliable because of the interface tricks that Apple routinely pulls.
TechZen
+1  A: 

Actually apple uses its kernal driver AppleJPEGDriver, It is a hardware jpeg encoding api and is much faster than software encoding (JPEGRepresnetaion) and some of the people using it in their jailbreak apps(cycorder video recording application). Apple should give the same functionality to its users but they are apple :)

Sridhar