Cope for images that are not even sized
Simon Schampijer
14 years ago
305 | 305 | def _load_image(self, index): |
306 | 306 | pixbuf_t = gtk.gdk.pixbuf_new_from_file_at_size( |
307 | 307 | 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) | |
309 | 318 | _logger.error('Picture Loaded: '+index) |
310 | 319 | self.emit('has-picture', True) |
311 | 320 | del pixbuf_t |
321 | del pixbuf_z | |
312 | 322 | |
313 | 323 | def _import_audio(self, widget, event): |
314 | 324 | if hasattr(mime, 'GENERIC_TYPE_AUDIO'): |
Binary diff not shown