diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2007-12-13 02:36:45 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2007-12-13 02:36:45 +0000 |
| commit | d119475f0c4221546ed2952164808c2114173a67 (patch) | |
| tree | 2db170bd349426f165663908e12021f1050951d5 /lib/python/Tools | |
| parent | e25ac974810a9c235242d5a4f6bb0c779ddb430a (diff) | |
| download | enigma2-d119475f0c4221546ed2952164808c2114173a67.tar.gz enigma2-d119475f0c4221546ed2952164808c2114173a67.zip | |
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')
Diffstat (limited to 'lib/python/Tools')
| -rw-r--r-- | lib/python/Tools/LoadPixmap.py | 12 |
1 files 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 |
