Using the camera example for python here I added
actual code to the buffer callback to actually save a picture, like so:
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?
def buffer_cb(self, element, buffer, pad):
self.picture_taken = False
print "picture taken"
image = Image.fromstring("P", (640,480), buffer)
image = image.convert("RGB")
Thanks in advance