Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix attributes with binary asset (e.g. DOM.img) #211

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

SimonDanisch
Copy link
Owner

fixes:

function img2binary(img)
    io = IOBuffer()
    show(io, MIME"image/png"(), img)
    return Bonito.BinaryAsset(take!(io), "image/png")
end

App() do app
    img_array = FileIO.load("...")
    DOM.img(src=img2binary(img_array))
end

@SimonDanisch SimonDanisch merged commit 358df58 into master Jan 11, 2024
4 checks passed
@SimonDanisch SimonDanisch deleted the sd/binary-asset branch January 11, 2024 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant