Codebase list sugar-memorize-activity / 5b1e1af
Cope for images that are not even sized Simon Schampijer 14 years ago
2 changed file(s) with 11 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
305305 def _load_image(self, index):
306306 pixbuf_t = gtk.gdk.pixbuf_new_from_file_at_size(
307307 index, theme.PAIR_SIZE - theme.PAD*2, theme.PAIR_SIZE - theme.PAD*2)
308 self.card.set_pixbuf(pixbuf_t)
308 if pixbuf_t.get_width() > pixbuf_t.get_height():
309 size = pixbuf_t.get_width()
310 else:
311 size = pixbuf_t.get_height()
312 pixbuf_z = gtk.gdk.pixbuf_new_from_file_at_size(
313 'images/white.png', size, size)
314 pixbuf_t.composite(pixbuf_z, 0, 0, pixbuf_t.get_width(),
315 pixbuf_t.get_height(), 0, 0, 1, 1,
316 gtk.gdk.INTERP_BILINEAR, 255)
317 self.card.set_pixbuf(pixbuf_z)
309318 _logger.error('Picture Loaded: '+index)
310319 self.emit('has-picture', True)
311320 del pixbuf_t
321 del pixbuf_z
312322
313323 def _import_audio(self, widget, event):
314324 if hasattr(mime, 'GENERIC_TYPE_AUDIO'):
Binary diff not shown