Monday, May 7, 2012

Pictures Repair and Cleanup for Epic CM9

Epic isn't that old!
All pictures taken since the start of CM9 for the Epic have contained invalid GPS data that have affect how the pictures are shown in Gallery, this caused photos to appear out of order as Gallery thinks they were taken in year 1969.  Additionally there were previously issues with removable storage but people's thumbnails were still incorrect and not matching their respective pictures.  Also Beta2 and earlier suffered from an issue where if CPU minimum and maximum frequencies were modified they would lose 100Mhz setting so the phone would idle at 200MHz instead of dropping to 100MHz when idle.

Beta 3 has all these issues resolved but the pictures already taken are still affected as well as settings saved for the processor.

This patch does the following:
  • Removes ALL GPS data from CM9 and CM7 pictures
    • Pictures taken with Touchwiz ROMs are not affected
    • Pictures taken with GPS Location ON with Beta 3 and newer as well as CM7 WILL lose GPS data from those pictures if they are not backed up elsewhere before flashing!
  • Clears Gallery's thumbnail cache and databases so it can rescan all the images fresh
    • Gallery may show some of your pictures with GPS data in details but that is just stored in the database and not in the file and will be lost after the script is ran.
  • Wipes the /data/system/throttle folder so CPU governor and states will start at default frequencies
Depending on the number of pictures this can take several minutes. I recommend keeping the phone plugged in while running to ensure the process is not interrupted.

Time stamps shown by Gallery will be off by your Time Zone (-4 hours to -6 hours here in the US). This is a bug affecting all android OSes to present and is NOT device specific. Even with the time-stamps being off the pictures have the correct order and will be read correctly when uploaded to the web or other devices.

Download [1]
Flash in CWM Recovery.

If you appreciate this work, please consider supporting the Epic CM team. Thank you!


  1. I applied this .zip last night and it didn't work.
    Pictures are still scrambled.

    1. It puts a log on the SDcard named gpsfix.log. Please tell me what that log says. Thanks.

  2. 104 image files updated
    31 image files unchanged

  3. It didn't work at all on mine. gpsfix.log says:

    0 image files updated
    1 image files unchanged

    I have 38 pics in my DCIM/Camera folder and 73 pics across six folders in the main Pictures folder. I applied the fix three times, each with a reboot - no go.

    1. This will only clear invalid GPS data for pictures stored in the default location of DCIM/Camera/IMG*.jpg which is the naming convention the camera uses. If pictures are renamed or moved they will not be affected.

    2. So there's no way to strip the 1969 date off of all of my other pics? Damn.

    3. I use batch rename utility. Its great for iPhonies image.jpg and photo.jpg file naming bs.

      I set it to strip out the entire filename then rename it based on date taken or date modified. You can do all kinds of stuff.

  4. 124 image files updated
    68 image files unchanged
    3 files weren't updated due to errors

    after running this (yesterday) it changed the timestamp on a whole bunch of images to 05/09/2012. is that the 124 it updated?

  5. Is everyone here running one of the pre-beta3 releases or still running beta2? The Gallery/Mediascanner has issues still but that is a global issue unfortunately. If the Gallery/media scanner can't read the exif information from the picture it will use the date modified from the pictures. We are hoping Google will patch the media scanner and gallery to read the image data correctly from the pictures.

    1. I'm running beta3 pre12. Upgraded from pre9.

  6. I was running beta 3 pre 9.
    It's funny because when I flash the temp rom via sd (which is stock TW), pictures are fine.
    However, back on CM9, all pictures are scrambled.

  7. Half my images were fixed, the other half still thinks it's 1969