bug: exception when showing image in jupyter notebook
Describe the bug
To Reproduce
No response
Expected behavior
No response
Component(s)
Expressions
Additional context
No response
When you do a url_download, the returned type is a binary which is why it shows as a base64 string.
The error looks like your jpeg has an unsupported encoding 'Rgba8' but we do support this with "rgba". Could you try url_download(url).image.decode('RGBA')
@chuanlei-coding please let me know if the suggestion works for you, thank you!
@chuanlei-coding please let me know if the suggestion works for you, thank you!
import daft
df = daft.from_pydict(
{
"urls": [
"https://www.getdaft.io/_static/stairs.png",
]
}
)
df2 = df.with_column("image", df["urls"].url.download().image.decode())
df2.show()
daft cannot deal with png image currently.
Took a quick look, this bug only happens when we preview images in a notebook. In these cases we were incorrectly encoding images that have an alpha channel as JPEG.
Fix is here https://github.com/Eventual-Inc/Daft/pull/4255
Ran into this today... And you all fixed it pre-emptively already :) good job!