×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    photo + metadata = one file

    Can I take a photo (with N95) and add some metadata to the same file?

  2. #2
    Nokia Developer Moderator
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,796

    Re: photo + metadata = one file

    Quote Originally Posted by DrivingMobileInnovation View Post
    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

  3. #3
    Regular Contributor
    Join Date
    Sep 2005
    Location
    Finland, Helsinki
    Posts
    323

    Re: photo + metadata = one file

    Quote Originally Posted by DrivingMobileInnovation View Post
    Can I take a photo (with N95) and add some metadata to the same file?
    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.

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: photo + metadata = one file

    Great! Thanks a lot.

  5. #5
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: photo + metadata = one 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.

  6. #6
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: photo + metadata = one file

    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.

  7. #7
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: photo + metadata = one file

    Quote Originally Posted by DrivingMobileInnovation View Post
    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
    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

  8. #8
    Super Contributor
    Join Date
    Mar 2003
    Location
    Espoo, Finland
    Posts
    976

    Re: photo + metadata = one file

    Quote Originally Posted by DrivingMobileInnovation View Post
    I mean how I can install that pexif to my phone?
    When everything else fails, copy & paste the other code inside your own script. Might have to remove some stuff, but makes installation a lot easier.

    Cheers,

    --jouni

  9. #9
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: photo + metadata = one file

    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..

  10. #10
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: photo + metadata = one file

    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?

  11. #11
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: photo + metadata = one file

    Quote Originally Posted by DrivingMobileInnovation View Post
    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?
    hi DrivingMobileInnovation
    The problem can with your code plz can you show bit of code so that the forum can help more.
    thanks

  12. #12
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: photo + metadata = one file

    The code is exactly same in both cases. It's in Pexif examples. Maybe Nokia files aren't supported.

  13. #13
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: photo + metadata = one file

    hi DrivingMobileInnovation
    it seems there can be some other problem with the phone itself. might be some sort of settings

  14. #14
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: photo + metadata = one file

    N95 camera creates its own exif header to a photo. And I think that's why Pexif can't handle it.

  15. #15
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    57

    Re: photo + metadata = one file

    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.

Similar Threads

  1. [announce] PyUIQ. Python for UIQ 2.1 and 3.x
    By OscarBernabeu in forum Symbian
    Replies: 35
    Last Post: 2008-01-17, 09:12
  2. Contacts fields order??
    By timatima in forum Symbian
    Replies: 1
    Last Post: 2007-06-08, 13:51
  3. Automatically sending photo with metadata
    By jje007 in forum Mobile Java General
    Replies: 1
    Last Post: 2005-04-29, 20:18
  4. Automatically sending photo with metadata
    By jje007 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 1
    Last Post: 2005-04-27, 08:40
  5. How to create mbm file?
    By qt_raip in forum Symbian Tools & SDKs
    Replies: 13
    Last Post: 2004-05-12, 11:07

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×