Can I take a photo (with N95) and add some metadata to the same file?
Can I take a photo (with N95) and add some metadata to the same file?
Hi and welcome to PyS60,
Yes, using Python for S60 you can take a photo with N95.
What kind of metadata do you want to add to the file ?
If it the data like date / time or any other text data then you could have them as the filename of the clicked photo. This way you will have both in one file.
Best Regards
Croozeus
Pankaj Nathani
www.croozeus.com
Yes. You can open the file with pexif and write e.g. Image Description and GPS Location tags into the file's EXIF-header and then save the file.
Should I copy that pexif.py file to my phone \sys\bin folder?
Or how can I import it to my application?
Last edited by DrivingMobileInnovation; 2008-04-04 at 21:54.
I mean how I can install that pexif to my phone? I know this is a stupid question but I don't get it work.
Ok, no it works. Correct folder is E:\\python\\lib
Last edited by DrivingMobileInnovation; 2008-04-09 at 20:30.
hi DrivingMobileInnovation
the forum is al about spreading the knowledge. And dont worry abt asking stupid questions. Forum is to help developers in any sort of matter.
And dont forget to install the Lib files always in the E:\\python\\libs. and in the main code import that.
thanks
Last edited by gaba88; 2008-04-09 at 20:44. Reason: incmplete answer
Gargi Das- http://gargidas.blogsot.com
Forum Nokia Python Wiki
Learn Python at http://mobapps.org/PyS60
Is it possible to use phone's camera application and automatically add metada to those image files with pexif when you shoot a picture? I think it should be then some kind of background application..
When I take a photo with my N95 camera app and try to add data to the file using pexif, it says unknown maker: Nokia.
But if I use selfmade Python Camera app, it works fine.
So how can I solve this problem?
Gargi Das- http://gargidas.blogsot.com
Forum Nokia Python Wiki
Learn Python at http://mobapps.org/PyS60
The code is exactly same in both cases. It's in Pexif examples. Maybe Nokia files aren't supported.
hi DrivingMobileInnovation
it seems there can be some other problem with the phone itself. might be some sort of settings
Gargi Das- http://gargidas.blogsot.com
Forum Nokia Python Wiki
Learn Python at http://mobapps.org/PyS60
N95 camera creates its own exif header to a photo. And I think that's why Pexif can't handle it.
Here is my simple code example (made for N95):
Code:import e32, appuifw, key_codes, os, os.path, pexif, sys, time from pexif import JpegFile from e32 import * def app_path(): global PATH PATH = 'e:\\Images\\' + year + month + '\\' + year + month + 'A0' # photo folder if not os.path.exists(PATH): os.makedirs(PATH) def date(): global month, year year = str(time.localtime()[0]) # 2008 2009 and so on m = time.localtime()[1] if m < 10: month = '0' + str(m) # 01 02 03 04 05 06 07 08 09 else: month = str(m) # 10 11 12 def old_pics(): global i i=0 for f in os.listdir(PATH): # amount of old pics i+=1 def new_pics(): global filename a=0 for f in os.listdir(PATH): # amount of new pics a+=1 if a > i: # if there is more new pics than old ones, add data to the exif filename = f save_exif() def save_exif(): img = pexif.JpegFile.fromFile(PATH + '\\' + filename) img.get_exif().get_primary()[pexif.ImageDescription] = "Hello world!" img.writeFile(PATH + '\\' + filename) def camera(): start_exe('z:\\system\\apps\\cammojave.exe','',1) # N95 camera app def quit(): app_lock.signal() appuifw.app.body = canvas = appuifw.Canvas() appuifw.app.screen = "large" appuifw.app.exit_key_handler = quit date() app_path() old_pics() camera() new_pics() app_lock = e32.Ao_lock() app_lock.wait()
Last edited by DrivingMobileInnovation; 2008-04-29 at 20:01.