Skip to content

Commit

Permalink
fix(diagram): re-enable automatic JPEG rendering through Base.show
Browse files Browse the repository at this point in the history
This was previously disabled as all diagram types that were meant to
support JPEG did not actually support JPEG output. Support for some of
these diagram types has either been removed[^1] or added[^2] making the
functionality reliable again.

[^1]: https://github.com/yuzutech/kroki/releases/tag/v0.21.0
[^2]: https://github.com/yuzutech/kroki/releases/tag/v0.18.0
  • Loading branch information
bauglir committed Apr 23, 2024
1 parent bb4a051 commit 131f93f
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/Kroki.jl
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,6 @@ Base.showable(::MIME"image/svg+xml", ::Diagram) = true
Base.showable(::T, diagram::Diagram) where {T <: MIME} =
Symbol(lowercase(String(diagram.type))) get(LIMITED_DIAGRAM_SUPPORT, T(), Tuple([]))

# Calling `Base.show` for JPEGs is explicitly disabled, for the time being.
# JPEG rendering is broken for all, supposedly supported, diagram types in the
# Kroki service. Should the support be fixed in the service, this method can be
# easily redefined by consuming software to support JPEG in case Kroki.jl has
# not been updated and released.
#
# Note that this only affects automatic rendering of `Diagram`s to JPEGs in
# supported environments. It is still possible to use `render` to render JPEGs
Base.showable(::MIME"image/jpeg", ::Diagram) = false

"""
Defines the MIME type to be used when `show` gets called on a [`Diagram`](@ref)
for the `text/plain` MIME type.
Expand Down

0 comments on commit 131f93f

Please sign in to comment.