[Etoys] Viewing a preview
Karl Ramberg
karlramberg at gmail.com
Sun Jan 18 06:27:08 EST 2009
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.
Karl
> On Sat, Jan 17, 2009 at 9:40 AM, Karl Ramberg <karlramberg at gmail.com> wrote:
>
>> Hi,
>> I'm testing out stuff in my JournalMorph but run into stuff I can't
>> figure out.
>>
>> I'm trying to view a png preview stored in a ByteArray but I don't get
>> it to work.
>> I make the ByteArray a RWBinaryOrTextStream but the
>> PNGReadWriter formFromStream: aStream do not recognize the format.
>>
>> I'm not sure how to proceed.
>>
>> I also tried to write out a png to the Journal but that would not work
>> either :-(
>>
>> Karl
>>
>>
>>
>> _______________________________________________
>> Etoys mailing list
>> Etoys at lists.laptop.org
>> http://lists.laptop.org/listinfo/etoys
>>
>>
>
>
>
>
More information about the Etoys
mailing list