elaborated on init str generation
This commit is contained in:
@@ -7,6 +7,8 @@ from base64 import b64encode
|
|||||||
init_img_path = Path(__file__).parent / "init_img.png"
|
init_img_path = Path(__file__).parent / "init_img.png"
|
||||||
with open(init_img_path.absolute(), "rb") as fh:
|
with open(init_img_path.absolute(), "rb") as fh:
|
||||||
init_img_enc = b64encode(fh.read()).decode("utf-8")
|
init_img_enc = b64encode(fh.read()).decode("utf-8")
|
||||||
|
# generate init img string
|
||||||
|
init_img_src = f"data:image/png;base64, {init_img_enc}"
|
||||||
|
|
||||||
image_element = dmc.Center(
|
image_element = dmc.Center(
|
||||||
html.Img(
|
html.Img(
|
||||||
@@ -14,6 +16,6 @@ image_element = dmc.Center(
|
|||||||
"width": "100%",
|
"width": "100%",
|
||||||
},
|
},
|
||||||
id="image-container",
|
id="image-container",
|
||||||
src=f"data:image/png;base64, {init_img_enc}"
|
src=init_img_src
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user