From d119475f0c4221546ed2952164808c2114173a67 Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Thu, 13 Dec 2007 02:36:45 +0000 Subject: [PATCH] add jpg support. Please note that 32bit bitmaps require 4x the memory of 8bit, possibily reducing available memory and performance. further, add support for images with split rgb,a channels, by specifying the basename plus a dot (i.e., everything before the 'a.png'/'rgb.jpg') --- lib/python/Tools/LoadPixmap.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/python/Tools/LoadPixmap.py b/lib/python/Tools/LoadPixmap.py index 033b8437..b7838a39 100644 --- a/lib/python/Tools/LoadPixmap.py +++ b/lib/python/Tools/LoadPixmap.py @@ -1,7 +1,15 @@ -from enigma import loadPNG +from enigma import loadPNG, loadJPG def LoadPixmap(path, desktop = None): - ptr = loadPNG(path) + if path[-4:] == ".png": + ptr = loadPNG(path) + elif path[-4:] == ".jpg": + ptr = loadJPG(path) + elif path[-1:] == ".": + alpha = loadPNG(path + "a.png") + ptr = loadJPG(path + "rgb.jpg", alpha) + else: + raise "neither .png nor .jpg, please fix file extension" if ptr and desktop: desktop.makeCompatiblePixmap(ptr) return ptr -- 2.30.2