Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2014-07-15 19:57:25 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2014-07-15 19:57:25 (GMT)
commit1f288e90971b8b6dc456d5a0545e4d508eaaeeed (patch)
treec6d3b5faaef4939fe26a9d45ae191b2ef680da3e
parentf55548618dd57645fe7cc2464ba23a708aa2cd8f (diff)
Better load of images
-rw-r--r--svgcard.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/svgcard.py b/svgcard.py
index 314a6e2..f2812c3 100644
--- a/svgcard.py
+++ b/svgcard.py
@@ -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: