diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2014-07-15 19:57:25 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2014-07-15 19:57:25 (GMT) |
commit | 1f288e90971b8b6dc456d5a0545e4d508eaaeeed (patch) | |
tree | c6d3b5faaef4939fe26a9d45ae191b2ef680da3e | |
parent | f55548618dd57645fe7cc2464ba23a708aa2cd8f (diff) |
Better load of images
-rw-r--r-- | svgcard.py | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -218,15 +218,9 @@ class SvgCard(Gtk.EventBox): if not self.flipped_once: if self.jpeg is not None: - pixbuf_t = GdkPixbuf.Pixbuf.new_from_file(self.jpeg) - if pixbuf_t.get_width() != self.size - 22 \ - or pixbuf_t.get_height() != self.size - 22: - self.jpeg = pixbuf_t.scale_simple( - self.size - 22, self.size - 22, - GdkPixbuf.InterpType.BILINEAR) - del pixbuf_t - else: - self.jpeg = pixbuf_t + image_size = self.size - style.DEFAULT_SPACING * 2 + self.jpeg = GdkPixbuf.Pixbuf.new_from_file_at_size( + self.jpeg, image_size, image_size) self.flipped_once = True if full_animation: |