anpassung für transparente png konvertierung

This commit is contained in:
Eva Möller
2012-08-21 13:43:44 +02:00
parent 8e2f0acb59
commit 76303817a1
3 changed files with 12 additions and 9 deletions
+5 -5
View File
@@ -21,7 +21,6 @@ def create_picture_frame( config ):
params = dict()
params['width'] = config.get('globals', 'width')
params['height'] = config.get('globals', 'height')
params['background'] = config.get('globals', 'background')
#echo '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">'
begintpl = '''<?xml version="1.0" encoding="UTF-8" standalone="no"?>
@@ -34,14 +33,15 @@ def create_picture_frame( config ):
height="${height}"
>
'''
imagetpl = ''' <image width="${width}" height="${height}"
xlink:href="file://${background}">
</image>
'''
svgbegin = Template( begintpl ).substitute(params)
# falls ein Hintergrundbild verwendet werden soll, dann das genauso gross
# machen...
try:
params['background'] = config.get('globals', 'background')
imagetpl = ''' <image width="${width}" height="${height}"
xlink:href="file://${background}">
</image>
'''
background = config.get('globals', 'background')
font_path = os.path.expandvars(os.path.join('$PICCREATE_BACKGROUNDS', background ))
params['background'] = os.path.normpath(font_path)