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

Add support to display PNG for arbitrary types #76

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jwortmann
Copy link

This would allow to display images for arbitrary user types, as long as they provide an implementation for Base.show for the MIME type image/png as described at https://docs.julialang.org/en/v1/manual/types/#man-custom-pretty-printing.

Example:

julia> using PNGFiles, TesetImages, ImageInTerminal

julia> struct Foo end

julia> Base.show(io::IO, ::MIME"image/png", ::Foo) = PNGFiles.save(io, testimage("mandrill"))

julia> foo = Foo()

julia> display("image/png", foo)

ImageInTerminal

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