Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorent Pigout <florent.pigout@gmail.com>2011-11-10 00:51:59 (GMT)
committer Florent Pigout <florent.pigout@gmail.com>2011-11-10 00:51:59 (GMT)
commitc910b3a02e370e8ed2250e55213a21322ec255b1 (patch)
treece49f596ac1c2a449f6e8268327bf092ff1b66b6
parent8fe421abd4d75719af54cc05b81a84b260c816e8 (diff)
fix same packaging issue again :|
-rw-r--r--atoidejouer/tools/image.py2
-rw-r--r--atoidejouer/tools/storage.py18
2 files changed, 11 insertions, 9 deletions
diff --git a/atoidejouer/tools/image.py b/atoidejouer/tools/image.py
index 89314dd..ada3bdd 100644
--- a/atoidejouer/tools/image.py
+++ b/atoidejouer/tools/image.py
@@ -69,7 +69,7 @@ def get_sequence_first_graphic(type_, sequence_name, size=None):
def compute_width_height(width, height, max_width, max_height, use_max=False):
# compute ratio
_ratio_scr = max_width / float(max_height)
- _ratio_img = width / float(height)
+ _ratio_img = 0 if not height else width / float(height)
if width > max_width\
or height > max_height:
if _ratio_img > _ratio_scr:
diff --git a/atoidejouer/tools/storage.py b/atoidejouer/tools/storage.py
index 834ed46..0985360 100644
--- a/atoidejouer/tools/storage.py
+++ b/atoidejouer/tools/storage.py
@@ -100,12 +100,15 @@ def get_pixbuf_from_data(data, image_type=None, size=None):
_w, _h = image.compute_width_height(_w, _h, _max_w, _max_h)
# set loader size
_loader.set_size(_w, _h)
- # load data
- _loader.write(data)
- # close loader
- _loader.close()
- # pix it
- return _loader.get_pixbuf()
+ try:
+ # load data
+ _loader.write(data)
+ # close loader
+ _loader.close()
+ # pix it
+ return _loader.get_pixbuf()
+ except Exception, e:
+ logger.debug('[tools.storage] get_pixbuf_from_data - e: %s' % e)
def __remove_inner_true(a_list):
@@ -435,11 +438,10 @@ def __check_dir_files(sub_path, mime_type=None, in_journal=False):
def init_activity_files():
+ __check_dir_files('db')
# add embedded resources to the journal for common usage (if not already loaded)
if not __check_dir_files('graphics', mime_type='image/png', in_journal=True):
__check_dir_files('sounds', mime_type='audio/ogg', in_journal=True)
- # ..
- # __check_dir_files('db', mime_type='atoidejouer/db', in_journal=True)
def __show_in_out_result_message(label, message):