Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/atoidejouer/tools/image.py
diff options
context:
space:
mode:
Diffstat (limited to 'atoidejouer/tools/image.py')
-rw-r--r--atoidejouer/tools/image.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/atoidejouer/tools/image.py b/atoidejouer/tools/image.py
index c2d966c..89314dd 100644
--- a/atoidejouer/tools/image.py
+++ b/atoidejouer/tools/image.py
@@ -1,6 +1,11 @@
# python import
-import gtk, logging, os, struct, StringIO
+import logging, os, struct, StringIO
+
+try:
+ import gtk
+except Exception, e:
+ gtk = None
# atoidejouer import
from atoidejouer.tools import registry, storage
@@ -10,6 +15,8 @@ logger = logging.getLogger('atoidejouer')
def get_pixbuf(file_path, max_width, max_height, use_max=False):
+ if gtk is None:
+ return None
# little check
_pixbuf = registry.PixRegistry().get_pix(file_path, max_width, max_height)
# already exist