You Are Here:

Community: Developer Discussion Boards

#1 Old Unhappy Problems taking pictures with the camera using gstreamer (on nokia N810) - 2008-12-11, 21:03

Join Date: Dec 2008
Posts: 3
phil232fm
Offline
Registered User
Hi

Using the camera example for python here I added
actual code to the buffer callback to actually save a picture, like so:

Code:
def buffer_cb(self, element, buffer, pad):
        if self.picture_taken:
            self.picture_taken = False
            print "picture taken"
            image = Image.fromstring("P", (640,480), buffer)
            image = image.convert("RGB")
            image.save("picture.jpg")
            
        return True
The problem is that the picture turns out in grayscale. If I set the mode for the fromstring method to "RGB" or "CMYK" it gives a "ValueError: not enough image data" error, and only the "P" mode seems to work. This seems odd as looking at the size of the buffer recieved (as a string) it is definately big enough for a colour image at 640*480. Does anyone have any clue what's going on?

Thanks in advance
Last edited by phil232fm : 2008-12-11 at 21:29. Reason: missed model in title
Reply With Quote

#2 Old Re: Problems taking pictures with the camera (on nokia N810) - 2008-12-12, 08:16

Join Date: May 2004
Posts: 524
Location: Tampere, Finland
jethro.fn's Avatar
jethro.fn
Offline
Forum Nokia Champion
You may need to configure the raw decoder to match the input format (see the raw decoder documentation):

Code:
image = Image.fromstring("RGB", (640, 480), buffer, "raw", "RGB", 0)
Experiment with the raw mode and stride parameters to get a correct image.

By the way, this forum is mainly populated by people who use PyS60 (Python for S60 phones). Maemo-specific questions probably get more answers on maemo.org developer mailing list or internettablettalk.com (soon to be called talk.maemo.org) forums.
Reply With Quote

#3 Old Re: Problems taking pictures with the camera using gstreamer (on nokia N810) - 2008-12-12, 11:59

Join Date: Nov 2008
Posts: 5
forexsystemprofi
Offline
Registered User
Thank you, you gave me the clue.


----
Metatrader Expert ( http://iticsoftware.com ), Scalping Forex ( http://iticsoftware.com/scalping-forex.php ), Forex Trading Systems ( http://shop.profxtools.com )
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
Cellphones challenge cameras with sharper pictures jennyyu General Discussion 0 2008-06-18 10:23
Disable camera Asmodeusz Symbian Media (Graphics & Sounds) 2 2008-04-30 11:02
embedable camera application?? zhengyu97 General Symbian C++ 0 2005-04-22 12:09
7710 MMAPI camera snapsot gives low res pictures akmits Mobile Java Media (Graphics & Sounds) 0 2005-03-09 23:31
Compatibility problems with camera API on 6600 fredrik99 General Symbian C++ 3 2003-12-10 04:35

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