[Etoys] Viewing a preview

Bert Freudenberg bert at freudenbergs.de
Sun Jan 18 09:09:04 EST 2009


On 18.01.2009, at 20:27, Karl Ramberg wrote:

> Walter Bender wrote:
>> Here is the Python/GTK way to do this, for what it is worth:
>>
>> from sugar.datastore import datastore
>> ...
>>        #my_dsobject is of type datastore.DSObject
>>        #object_id is a datastore object
>>        my_dsobject = datastore.get(object_id)
>>
>>        pixbufloader =  
>> gtk.gdk.pixbuf_loader_new_with_mime_type('image/png')
>>        #Access the 'preview' property
>>        #Note that the preview image is 300x225
>>        pixbufloader.write(dsobject.metadata['preview'])
>>        pixbufloader.close()
>>        pixbuf = pixbufloader.get_pixbuf()
>>
>> -walter
>>
> Thanks.
> I got it working my self but there are quite a few of the previews  
> that
> don't seem to work, and most criticaly photos from Record I can't  
> get to
> work.


Many Journal entries do not have a preview. Some Journal entries do no  
even have an associated file.

- Bert -




More information about the Etoys mailing list