Skip to Content

Delving into the iPhone's DCIM folder

Today, Dave Caolo discovered what happens when your iPhone camera rolls past picture number 99999 (or so). As he and other Apple users have found, a picture count that goes too high can lead to unforseen errors. Human sacrifice. Dogs and cats living together. Mass hysteria. Or a camera roll that doesn't acknowledge new photos.

Snapped images are stored on your iPhone in your home folder. As user "mobile," that home folder is /var/mobile and the folder that stores your iTunes library, your voice memos, and your photos is /var/mobile/Media. Inside that media folder is a subfolder named DCIM.

Read on for more details.

Standing for digital camera images, the DCIM folder follows the Japan Electronics and Information Technology Industries Association (JEITA) naming specification for digital still cameras.

Inside /var/mobile/Media/DCIM, you typically find an image subfolders. ###APPLE (starting with 100APPLE, and going up from there) folders store pictures snapped by the iPhone camera (IMG_0001.JPG, IMG_0002.JPG, etc). Until the 3.0 firmware, the 999APPLE folder has stored shots of the iPhone screen. With 3.0 and later, those shots appear to be directed into the other APPLE folders and saved with PNG extensions. Thumbnails and other helper files appear in a sub-sub-folder called .MISC.

TUAW Tip: Press and hold the Sleep/Wake button and tap the Home key to take screenshots. The screen flashes white to let you know that the shot has been added to your DCIM folder.

There is another subfolder in the top DCIM folder called .MISC. Inside that folder, the iPhone camera application stores a couple of preview images and a property list. (See the screen shot at the top of this post.) This property list contains a counter for the last file shot. So, with the following Info.plist contents, the next photo to be snapped and stored into the 100APPLE folder will be IMG_0736.JPG.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LastFileGroupNumber-100</key>
<integer>736</integer>
</dict>
</plist>

Each time you pass 1000 photos, a new entry is added to this property list and a new subfolder created in DCIM. After 999 groups, and I'm looking at you Dave, you run into trouble.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LastFileGroupNumber-100</key>
<integer>999</integer>
<key>LastFileGroupNumber-101</key>
<integer>1</integer>
</dict>
</plist>

So how can you solve Dave's dilemma? Although you can use Ecamm's PhoneView to copy that Info.plist file out from the .MISC folder and edit it directly. that's probably more effort and risk than you might want to deal with. Dave's posted solution seems to do the job pretty well. And after testing other methods this morning, I'm going to endorse his solution. Editing property list files is a pretty big hammer for what can be fixed with a tiny nail.

So why did I follow up? If this post is meant to do anything, it simply explains what is going on behind the scenes. It shows you what is going on in the DCIM folder and why that folder can run into problems when your snapped photo count gets too high.

This is clearly a problem that's begging for an Apple-side firmware fix. Hopefully they'll address the problem in the next firmware update. If you have developer credentials (they are free for online membership), you can file a radar at bugreport.apple.com. Duplicate bug reports count as "votes." The more votes a bug report gets, the more likely Apple is to fix that bug. They just need to fix the rollover code to accommodate people taking thousands of pictures.



Categories

iPhone

Today, Dave Caolo discovered what happens when your iPhone camera rolls past picture number 99999 (or so). As he and other Apple users...
 

Add a Comment

*0 / 3000 Character Maximum

14 Comments

Filter by:
NetMage

You can use iPhoneBrowser on Windows.

August 27 2009 at 9:48 AM Report abuse rate up rate down Reply
kinto

thanks for calling more attention to this erica. it's SUPER annoying and because i take A LOT of pix i've had to deal with this issue around 5 times since i got my 3GS like 2 months ago. i've sent bug reports to apple and posted in various forums so hopefully they fix this soon because i'm to the point that half the time i don't even trust that my iphone camera will actually work.

(and fortunately phoneview was part of the last macheist bundle... i never figured i'd even use it until the camera roll problem arose...)

August 27 2009 at 12:51 AM Report abuse rate up rate down Reply
1 reply to kinto's comment
kinto

oop sorry! and thanks to dave too =)

August 27 2009 at 12:56 AM Report abuse rate up rate down Reply
Will Maitner

And yet you can create folders in iPhoto and transfer them back to the phone. They need to change the picture app to allow you to do this on the phone. Maybe even add some minor editing abilities, iPhoto lite maybe?

August 26 2009 at 10:41 PM Report abuse rate up rate down Reply
Will Maitner

Why is there no way to create photo folders on the phone to address this issue. I hate that you can't move pics around inside camera roll. Stupid oversight on Apple's part.

August 26 2009 at 6:40 PM Report abuse rate up rate down Reply
1 reply to Will Maitner's comment
John.B

Because Apple (and pretty much every other camera mfgr today) leverages the DCIM standards on the camera side (for compatibility's sake). And FTA, that was never intended to do anything but temporarily hold image files until they could be transferred to a computer. http://en.wikipedia.org/wiki/DCIM

August 26 2009 at 8:27 PM Report abuse rate up rate down Reply
robert

Is there a way to get at this via the finder or does PhoneView communicate with the phone over USB?

August 26 2009 at 5:30 PM Report abuse rate up rate down Reply
1 reply to robert's comment
kinto

phoneview works via usb

August 27 2009 at 12:36 AM Report abuse rate up rate down Reply
tony d

OK, at the risk of confusing this issue I've got a question. So when we sync and upload photos to iPhoto and choose to delete the photos on the iPhone (when iPhoto asks) that the camera app doesn't reset itself? Or does this only happen when you leave the photos on the phone? I'm asking because my Nikon does reset itself, so this just sounds like a weird bug. Otherwise if the pictures are still on the phone it would be behaving normally, no?

August 26 2009 at 4:49 PM Report abuse rate up rate down Reply
NutMac

This is a common problem with DCIM format. Creators of DCIM assumed folks would download images to a computer before the storage is filled up with 99,999 images. On 2 MP iPhones, a typical photo is 500 KB or larger (screenshots may take much less), so one would need over 47 GB of storage to exceed the limit. So I don't see many folks running into this issue.

The whole situation could be remedied if it was easier to import and sync photos (as albums) back to iPhone. Current workflow for most Mac users involves (1) connecting the iPhone, (2) run iPhoto to import, (3) organize photos to one or more albums, (4) run iTunes, (5) select the albums you wish to sync back, and (6) sync.

August 26 2009 at 4:20 PM Report abuse rate up rate down Reply
1 reply to NutMac's comment
NutMac

Oh oops, I didn't read the post correctly. iPhone does not rollback to 000APPLE. My bad. Nevermind.

August 26 2009 at 4:24 PM Report abuse rate up rate down Reply
Steven

Or in this case, tens of thousands.

August 26 2009 at 3:50 PM Report abuse rate up rate down Reply
1 reply to Steven's comment
kinto

i concur.

it's a great camera... when it works.

August 27 2009 at 1:02 AM Report abuse rate up rate down Reply
Joshua Meadows

Wasn't there a similar sort of issue with text messages reaching a certain limit and causing problems? Apple fixed that one too; you'd think they'd have the foresight to speculate on this causing a problem as well.

August 26 2009 at 3:49 PM Report abuse rate up rate down Reply
Buy an ad here

Hot Apps on TUAW

Tweets

© 2012 AOL Inc. All Rights Reserved.