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

Walter Bender walter.bender at gmail.com
Thu Apr 8 17:27:57 EDT 2010

On Thu, Apr 8, 2010 at 5:21 PM, James Simmons <nicestep at gmail.com> wrote:
> 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 never been able to figure out how to get pygyk to resize the way
you describe either. In Turtle Art I do my own rescaling in much the
wqay you describe to maintain aspect ratios of blocks that have image
skins on them. If you find there is a better way, please b'cast.

> 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
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel

Walter Bender
Sugar Labs

More information about the Sugar-devel mailing list