Log in

No account? Create an account
nmea_info.py, now with geo tagged photos - Nick [entries|archive|friends|userinfo]

[ website | gagravarr.org ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

nmea_info.py, now with geo tagged photos [Dec. 17th, 2006|07:47 pm]
I've finally been able to get the S60 Python camera stuff to play nicely in my code, so I've been able to do a new version of nmea_info.py. This is now able to take photos, and having taken then, add the special Geo Exif headers, which record where you were when you took the photo.

To do this, it makes use of the excellent PExif. There's only one snag, which is that pexif assumes a larger size of int than S60 has, so will sometimes trigger a OverflowError. The solution is to edit line 905 of pexif.py, and drop the value of SEC_DEN to 10000.

Once you've done this, and installed pexif as a python library on your phone (or just loaded the .sis on, if you're not using a 3rd edition phone), you then get a new menu option, Take Photo. This will show you a preview, and you can use 1 and 3 to cycle through the resolutions to take at. When you're happy, hit 0 or enter, and it'll take the photo.

Annoyingly, the S60 python camera stuff is dog slow. So, it takes about a second to grab each preview shot, and about 2 seconds to take a real one. Add in a few seconds to save the image, and then geotag it, and it can be 7-8 seconds from when you hit enter until it's done. It's normally taken the photo after 2-3 seconds though!