Mar 26

Hi

NOTE: There is an update below in the text as Firmware 2 changed things a bit

If you own an iPhone, you know this. The built in Camera application takes pictures and names them IMG_xxxx.JPG, where xxxx is an ascending number starting at 0001.

This is to keep images named differently, so even if you put them all in one folder, all has a unique name, and nothing gets overwritten. Now this works great, up unitl you decide to flash your firmware, and upgrade. If you do that, this counter gets reset, and the naming starts again from IMG_0001.JPG, and on.

I am on my 5th firmware, so you can imagine the flustration. I have IMG_0001.JPG 5 times already, and need to rename them one by one to eliminate confusion.

Just recently I was wondering if there was a way to alter the Camera’s naming, and sure enough, I found the answer on a popular iPhone forum. Read on for instrucions if you are interested….

First of all, make sure you have Mobile Finder and Mobile Text Editor installed. If you dont have it, and don’t want it, then just enable WiFi access on the iPhone, enable SSH, and log in from a remote PC. This is what I did, but I realized the Finder way is easier, so I created some screenshots with the later method so that you can try it easily. After all, not everyone is familiar with Linux/Unix shells.

Just fire up Mobile Terminal on your iPhone, and make sure under options, you have View System files, etc enabled. Also make sure the setting for showing “..” is allowed, and therefore you will be able to change directories towards the root of the system.

Once Mobile Finder is set up, just go to the following path:

/var/mobile/Media/DCIM/.MISC/

Double tap on Info.plist, and Finder should lauch Text Editor to view the contents of the file.

At this line: < integer >xxx< /integer >, xxx stands for the number that is after IMG_ in the image’s name. Just change it to whatever is next in line for you, and the pictures will be named accordingly thereafter.

This has been a huge headache for me, and as it turned out, the solution wasn’t that difficult.

Hope you find it useful,

UPDATE: Since firmware 2, Mobile Terminal is no longer an accessible commodity through Installer, at least not at present. I am on 2.1 currently. You can however still edit the file via an SSH session, which is what I did and it worked great. You can also use gTxtEdit application that you can get from Cydia, and open the Info.plist file, edit then save it.

Cheers

11 Responses to “iPhone – Camera Roll picture naming – reset after firmware update”

  1. numps Says:

    Found this very useful…i grant u, one internet point…

  2. bence8810 Says:

    Glad it worked for you. Cheers

  3. Al Says:

    very useful! thanks! =)

  4. David Says:

    Thanks man..

    This article was great help to me
    Many thanks

  5. 3ald3eaver Says:

    AWESOME! Lifesaver!

  6. 3ald3eaver Says:

    edit: iPhone 3GS running 4.0.1
    This works great after a factory restore.

    Agree: modify /var/mobile/Media/DCIM/.MISC/Info.plist integer to last phone # plus 1 (ex: last photo taken 314+1 = 315)

    Next delete 3 files in /private/var/mobile/Media/PhotoData
    1. com.apple.photos.caches_metadata.plist
    2. Photos.sqlite
    3. PhotosAux.sqlite

    When you access the camera roll, it will update the library. You can also add pictures into /private/var/mobile/Media/DCIM/100APPLE prior to viewing the camera roll.

    *Make sure not to delete the last photo taken from the camera roll or it will reset the integer to 1 and you’ll have to perform this task again.

  7. Kevin Says:

    This doesn’t work anymore by the way (iOS 5.0) something else seems to be caching the sequence number now.

  8. Kevin Says:

    I googled some more, this fixes it: http://blog.mbentley.net/2010/06/iphone-ios-4-upgrade-restore-lost-pictures-in-camera-roll/

  9. mbeedub Says:

    Changing iPhone Picture naming index number on 3GS with iOS5

    Here’s what I did. Using iExplorer (http://www.macroplant.com/iexplorer/)

    1. Backed up (by dragging and dropping to folder on desktop):

    /Media/PhotoData/MISC/DCIM_APPLE.plist

    /Media/PhotoData/Photos.sqlite
    /Media/PhotoData/Photos.sqlite-shm
    /Media/PhotoData/Photos.sqlite.wal

    2. Using iExplorer, deleted the following on the iPhone

    /Media/PhotoData/Photos.sqlite
    /Media/PhotoData/Photos.sqlite-shm
    /Media/PhotoData/Photos.sqlite.wal

    3. Edited DCIM_APPLE.plist on the desktop so that contained the correct AND the correct folder number (if you are over 999 photos you need to increment the folder number to 101, if you are over 1999 photos you need to increment the folder number to 102 I think…)

    So:

    DCIMLastDirectoryNumber
    101
    DCIMLastFileNumber
    1638

    4. Dragged this edited DCIM_APPLE.plist over the one on the iPhone.

    Seems to work.

  10. mbeedub Says:

    Note in post 10, point 3, these comments don’t show XML markup so the plist fil should take the form at the top of this original post.

  11. Paul E Says:

    My friend has a filename problem which is a little more strange, I think.
    His iPhone gives every picture exactly the same name!
    Is there a setting for the namegiving somewhere?

Leave a Reply