add jpg support. Please note that 32bit bitmaps require 4x the memory of 8bit, possib...
authorFelix Domke <tmbinc@elitedvb.net>
Thu, 13 Dec 2007 02:36:45 +0000 (02:36 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Thu, 13 Dec 2007 02:36:45 +0000 (02:36 +0000)
lib/python/Tools/LoadPixmap.py

index 033b843..b7838a3 100644 (file)
@@ -1,7 +1,15 @@
-from enigma import loadPNG
+from enigma import loadPNG, loadJPG
 
 def LoadPixmap(path, desktop = None):
 
 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
        if ptr and desktop:
                desktop.makeCompatiblePixmap(ptr)
        return ptr