Skip to content
Snippets Groups Projects
Commit 965a7e47 authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

clean up

parent e7d921e6
No related branches found
No related tags found
No related merge requests found
...@@ -19,16 +19,15 @@ def enable_windows_cairo_support(): ...@@ -19,16 +19,15 @@ def enable_windows_cairo_support():
os.environ['PATH'] = os.environ['PATH'] + ';' + default_os_path os.environ['PATH'] = os.environ['PATH'] + ';' + default_os_path
if ctypes.util.find_library('cairo') is not None: if ctypes.util.find_library('cairo') is not None:
print("cairo installed: OK") print("cairo installed: OK")
enable_windows_cairo_support() enable_windows_cairo_support()
from cairosvg import svg2png from cairosvg import svg2png
from screeninfo import get_monitors
from IPython.display import SVG
from flatland.core.transitions import RailEnvTransitions
# from copy import copy # from copy import copy
from flatland.core.transitions import RailEnvTransitions
from screeninfo import get_monitors
class PILGL(GraphicsLayer): class PILGL(GraphicsLayer):
def __init__(self, width, height, nPixCell=60): def __init__(self, width, height, nPixCell=60):
...@@ -252,9 +251,6 @@ class PILSVG(PILGL): ...@@ -252,9 +251,6 @@ class PILSVG(PILGL):
def pilFromSvgFile(self, sfPath): def pilFromSvgFile(self, sfPath):
with open(sfPath, "r") as fIn: with open(sfPath, "r") as fIn:
bytesPNG = svg2png(file_obj=fIn, output_height=self.nPixCell, output_width=self.nPixCell) bytesPNG = svg2png(file_obj=fIn, output_height=self.nPixCell, output_width=self.nPixCell)
image = SVG(url=sfPath)
with io.BytesIO(bytesPNG) as fIn: with io.BytesIO(bytesPNG) as fIn:
pil_img = Image.open(fIn) pil_img = Image.open(fIn)
pil_img.load() pil_img.load()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment