manzt
manzt
Mmarimo
Created by manzt on 9/19/2024 in #help-support
View a local image (png/jpeg)
ahh mo.image()
12 replies
Mmarimo
Created by manzt on 9/19/2024 in #help-support
View a local image (png/jpeg)
hmm, maybe a different namespace?
12 replies
Mmarimo
Created by manzt on 9/19/2024 in #help-support
View a local image (png/jpeg)
Traceback (most recent call last): File "/Users/manzt/.cache/uv/archive-v0/DCgM2WuQ6B8IEZg0HzEjf/lib/python3.12/site-packages/marimo/_runtime/executor.py", line 171, in execute_cell return eval(cell.last_expr, glbls) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Cell marimo://demo.py#cell=cell-5 , line 1, in <module> mo.img(fp) ^^^^^^ AttributeError: module 'marimo' has no attribute 'img'
12 replies
Mmarimo
Created by manzt on 9/19/2024 in #help-support
View a local image (png/jpeg)
heck ya, I also go there with mo.Html... but this is cleaner 🙂
12 replies
Mmarimo
Created by manzt on 9/19/2024 in #help-support
View a local image (png/jpeg)
Any way to constrain the width?
12 replies
Mmarimo
Created by manzt on 9/19/2024 in #help-support
View a local image (png/jpeg)
seems to work!
12 replies
Mmarimo
Created by manzt on 9/19/2024 in #help-support
View a local image (png/jpeg)
import base64

class MyImage:
def __init__(self, fp: pathlib.Path) -> None:
self._url = f"data:image/jpeg;base64,{base64.encodebytes(fp.read_bytes()).decode("utf-8")}"

def _mime_(self) -> tuple[str, str]:
return ("image/jpeg", self._url)

MyImage(picker.value)
import base64

class MyImage:
def __init__(self, fp: pathlib.Path) -> None:
self._url = f"data:image/jpeg;base64,{base64.encodebytes(fp.read_bytes()).decode("utf-8")}"

def _mime_(self) -> tuple[str, str]:
return ("image/jpeg", self._url)

MyImage(picker.value)
12 replies
Mmarimo
Created by manzt on 8/23/2024 in #help-support
Install dependencies in wasm playground?
thank you!
4 replies