From 2931f2f1bc98096eb8d270ea467f8244a67e808c Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Wed, 06 Jun 2012 07:18:26 +0000 Subject: Add singular access point for getting image files; add 73% scaled images for resolution <=800 --- (limited to 'common/Config.py') diff --git a/common/Config.py b/common/Config.py index 85fa2bf..75bd43d 100644 --- a/common/Config.py +++ b/common/Config.py @@ -6,6 +6,8 @@ import gettext import logging from os.path import join +import gtk + from sugar.activity.activity import get_bundle_path, get_activity_root from sugar import env @@ -322,3 +324,13 @@ KEY_MAP_NOTPIANO = {24: 24, # Q 57: 48} # N KEY_MAP = KEY_MAP_PIANO + +if max(gtk.gdk.screen_width(), gtk.gdk.screen_height()) <= 800: + # Images created using `convert $i -resize 73%` command + IMAGE_ROOT = join(IMAGE_ROOT, '73', '') + + +def imagefile(filename): + if filename and not filename.startswith(os.sep): + filename = IMAGE_ROOT + filename + return filename -- cgit v0.9.1