Skip to content

Commit

Permalink
fix SVG generation script for Python3
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2839
  • Loading branch information
hkiel authored and OpenModelica-Hudson committed Dec 19, 2018
1 parent 7140453 commit 434838c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Examples/generate_icons.py
Expand Up @@ -295,7 +295,7 @@ def getGraphicsForClass(modelicaClass):
fname = os.path.join(baseDir, g[8].strip('"'))
if os.path.exists(fname):
with open(fname, "rb") as f_p:
graphicsObj['href'] = "data:image;base64,"+base64.b64encode(f_p.read())
graphicsObj['href'] = "data:image;base64,"+str(base64.b64encode(f_p.read()))
else:
logger.error("Could not find bitmap file {0}".format(g[8]))
graphicsObj['href'] = g[8].strip('"')
Expand Down Expand Up @@ -998,7 +998,7 @@ def getSvgFromGraphics(dwg, graphics, minX, maxY, includeInvisibleText, transfor
]

for (stopValue, idx) in stopValues:
gradient.add_stop_color(offset=stopValue, color='rgb({0}, {1}, {2})'.format(colors[idx][0], colors[idx][1], colors[idx][2]), opacity=1)
gradient.add_stop_color(offset=stopValue, color='rgb({0}, {1}, {2})'.format(int(colors[idx][0]), int(colors[idx][1]), int(colors[idx][2])), opacity=1)

definitions.add(gradient)
elif graphics['type'] == 'Rectangle':
Expand Down

0 comments on commit 434838c

Please sign in to comment.