Fixing My iPhone Camera
I recently updated my iPhone’s firmware to 1.1.3. Last weekend I took the boys to the park and used my phone to take a few photos (or so I thought), unfortunately when I got home there were no photos on the phone….
I searched the web and found a blog post and two Apple Support threads describing pretty much the same issue as I was seeing, unfortunately without a definitive fix….
"Topic : Camera will not save pictures to phone after snapping photo"
"Topic : My iphone will not save the photos I have taken with the phone"
Even though I rarely use the camera, the fact that it wasn’t working pissed me off so I decided to look around in the phone and see what I could see. Luckily I’m an old-school Unix guy so the iPhone directory structures and commands are familiar to me…
Anyway, after too much time spent poking around I found the problem… The directory that the camera saves into was missing and the parent directory was not writeable by the "mobile" user so even if the camera app can recreate the missing directory it was out of luck. I replaced the missing directory and fixed the parent directory permissions and it’s all working again….
I’ll post the details below, I also posted to the blog and Apple Support threads.
——8<——–
I recently updated to 1.1.3 (unlocked, jailbreak) and started experiencing the same problem. I rarely ever used the camera so I don’t know if it just started in 1.1.3.
Anyway it was really annoying me so I started poking around via ssh and found that if I ran the camera application manually as root then it seemed to work just fine.
/Applications/MobileSlideShow.app/MobileSlideShow –launchedFromSB –role Camera
I could take photos and look at them, they wouldn’t appear in iPhoto though. If I ran the camera as the "mobile" user which is the normal setting the problem would occur and I would see an error message each time I took a photo
/Applications/MobileSlideShow.app/MobileSlideShow –launchedFromSB –role Camera
CGImageDestinationCreate destination parameter is nil
This lead me to think that the problem is related to permissions as the behavior differed depending on the logged in user.
using the "find" command to see what files were changed today…
find / -mtime -0
I found that there were what looked to be photo files in the directory
/private/var/root/Media/DCIM/100APPLE
Now the camera preferences file has a reference to "DCFLastDirectoryNumber" and a value of "100", looking at the Media directory for the mobile user showed no "100APPLE" directory so I created the following directory
/private/var/mobile/Media/DCIM/100APPLE
mkdir /private/var/mobile/Media/DCIM/100APPLE
and changed the ownership to the mobile user
chown mobile:wheel /private/var/mobile/Media/DCIM/100APPLE
and now the camera is working again…..
I also noticed that the parent directory
/private/var/mobile/Media/DCIM
was not writeable by the mobile user so if the directory was deleted then the problem would occur again so I made in writeable by all
chmod 777 /private/var/mobile/Media/DCIM
Yes I know this poses a security risk, but then the only users on the system are root and mobile and I want them both to be able to write to the DCIM directory.
After the fix I was able to take photos, import them into iPhoto and delete the originals with no problems.
Note: This fix is maybe 10 minutes old so no guarantees. Also you need ssh access to the phone so only people with hacked phones can use this fix….
I hope it works for some of you at least…
Cheers
Dan
——8<—–

















