You Are Here:

Community: Developer Discussion Boards

Reply « Previous Thread | Next Thread »

#1 Old photo + metadata = one file - 2008-03-27, 23:15

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
Can I take a photo (with N95) and add some metadata to the same file?
Reply With Quote

#2 Old Re: photo + metadata = one file - 2008-03-28, 14:15

Join Date: May 2007
Posts: 2,739
Location: 21.46 N 72.11 E
croozeus's Avatar
croozeus
Offline
Forum Nokia Champion
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
Reply With Quote

#3 Old Re: photo + metadata = one file - 2008-03-28, 17:06

Join Date: Sep 2005
Posts: 314
Location: Finland, Helsinki
aaaaapo
Offline
Regular Contributor
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.
Reply With Quote

#4 Old Re: photo + metadata = one file - 2008-03-31, 23:15

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
Great! Thanks a lot.
Reply With Quote

#5 Old Re: photo + metadata = one file - 2008-04-04, 21:33

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
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 22:54.
Reply With Quote

#6 Old Re: photo + metadata = one file - 2008-04-09, 21:15

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
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 21:30.
Reply With Quote

#7 Old Re: photo + metadata = one file - 2008-04-09, 21:41

Join Date: Feb 2008
Posts: 2,546
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Last edited by gaba88 : 2008-04-09 at 21:44. Reason: incmplete answer
Reply With Quote

#8 Old Re: photo + metadata = one file - 2008-04-12, 21:59

Join Date: Mar 2003
Posts: 937
Location: Espoo, Finland
JOM's Avatar
JOM
Offline
Forum Nokia Champion
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
Reply With Quote

#9 Old Re: photo + metadata = one file - 2008-04-14, 21:20

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
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..
Reply With Quote

#10 Old Re: photo + metadata = one file - 2008-04-24, 23:10

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
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?
Reply With Quote

#11 Old Re: photo + metadata = one file - 2008-04-25, 05:30

Join Date: Feb 2008
Posts: 2,546
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
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


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#12 Old Re: photo + metadata = one file - 2008-04-25, 08:38

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
The code is exactly same in both cases. It's in Pexif examples. Maybe Nokia files aren't supported.
Reply With Quote

#13 Old Re: photo + metadata = one file - 2008-04-25, 12:42

Join Date: Feb 2008
Posts: 2,546
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
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
Reply With Quote

#14 Old Re: photo + metadata = one file - 2008-04-25, 19:34

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
N95 camera creates its own exif header to a photo. And I think that's why Pexif can't handle it.
Reply With Quote

#15 Old Re: photo + metadata = one file - 2008-04-28, 19:13

Join Date: Mar 2008
Posts: 57
DrivingMobileInnovation
Offline
Regular Contributor
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 21:01.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
[announce] PyUIQ. Python for UIQ 2.1 and 3.x OscarBernabeu Python 35 2008-01-17 10:12
Contacts fields order?? timatima General Symbian C++ 1 2007-06-08 14:51
Automatically sending photo with metadata jje007 Mobile Java General 1 2005-04-29 21:18
Automatically sending photo with metadata jje007 Mobile Java Media (Graphics & Sounds) 1 2005-04-27 09:40
How to create mbm file? qt_raip Symbian Tools & SDKs 13 2004-05-12 12:07

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia