[Sugar-devel] How to make image pixmaps a consistent six when the image file dimensions vary?

James Simmons nicestep at gmail.com
Thu Apr 8 17:21:03 EDT 2010


After studying sugar.activity.Activity I managed to get Sugar
Commander to add preview metadata to Journal entries created by
importing image files from the file system.  Unfortunately, the
Journal expects these images to be a consistent size.  It doesn't look
at the image itself and figure out how to fit it in the space
available.  Instead it assumes the image size and the end result is
often an image that is stretched horizontally or vertically.

I could make my own Activity display the images correctly but I want
the Journal to do that too.  So what I'd like to do is start with an
image, shrink it down so it fits inside 320x240, then pad it out as
needed to make it 320x240, then add that as the preview image.

I've been looking at PyGTK documentation and so far I haven't seen a
way to do that.  I have not had much luck with the PyGTK mailing lists
in the past so I thought I'd try asking here first.

Thanks,

James Simmons


More information about the Sugar-devel mailing list