diff options
| author | Andreas Frisch <andreas.frisch@multimedia-labs.de> | 2008-09-17 14:18:37 +0000 |
|---|---|---|
| committer | Andreas Frisch <andreas.frisch@multimedia-labs.de> | 2008-09-17 14:18:37 +0000 |
| commit | ad916414180e6d210b827ae9efdcd4ee1dca9e02 (patch) | |
| tree | a31b65002d1828bfb1e1b3db566da2f31abb3e16 /lib/python/Plugins | |
| parent | fba66d8bc7e6915c8152b73d6a37e73241e24c97 (diff) | |
| download | enigma2-ad916414180e6d210b827ae9efdcd4ee1dca9e02.tar.gz enigma2-ad916414180e6d210b827ae9efdcd4ee1dca9e02.zip | |
don't crash when python-imaging not installed
Diffstat (limited to 'lib/python/Plugins')
| -rw-r--r-- | lib/python/Plugins/Extensions/DVDBurn/Process.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/lib/python/Plugins/Extensions/DVDBurn/Process.py b/lib/python/Plugins/Extensions/DVDBurn/Process.py index fa01aa2c..b60cca20 100644 --- a/lib/python/Plugins/Extensions/DVDBurn/Process.py +++ b/lib/python/Plugins/Extensions/DVDBurn/Process.py @@ -400,7 +400,15 @@ def formatTitle(template, title, track): return template.decode("utf-8") def CreateMenus(job): - import os, Image, ImageDraw, ImageFont + try: + from ImageFont import truetype + import ImageDraw, Image, os + except ImportError: + job.project.session.open(MessageBox, ("missing python-imaging"), type = MessageBox.TYPE_ERROR) + if job.project.waitboxref: + job.project.waitboxref.close() + return False + imgwidth = 720 imgheight = 576 s = job.project.settings @@ -411,9 +419,9 @@ def CreateMenus(job): fontsizes = s.font_size.getValue() fontface = s.font_face.getValue() - font0 = ImageFont.truetype(fontface, fontsizes[0]) - font1 = ImageFont.truetype(fontface, fontsizes[1]) - font2 = ImageFont.truetype(fontface, fontsizes[2]) + font0 = truetype(fontface, fontsizes[0]) + font1 = truetype(fontface, fontsizes[1]) + font2 = truetype(fontface, fontsizes[2]) color_headline = tuple(s.color_headline.getValue()) color_button = tuple(s.color_button.getValue()) @@ -518,6 +526,7 @@ def CreateMenus(job): menuoutputfilename = job.workspace+"/dvdmenu"+str(menu_count)+".mpg" spumuxTask(job, spuxmlfilename, menubgmpgfilename, menuoutputfilename) + return True def CreateAuthoringXML(job): nr_titles = len(job.project.titles) @@ -605,7 +614,8 @@ class DVDJob(Job): def conduct(self): if self.project.settings.authormode.getValue().startswith("menu") or self.menupreview: - CreateMenus(self) + if not CreateMenus(self): + return CreateAuthoringXML(self) totalsize = 50*1024*1024 # require an extra safety 50 MB |
