Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/ImageShow.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function __init__()
@require ImageTransformations="02fcd773-0e25-5acc-982a-7f6622650795" _use_restrict(true)
end
include("showmime.jl")
include("compat.jl")

# facilitate testing from importers
testdir() = joinpath(@__DIR__,"..","test")
Expand Down
6 changes: 6 additions & 0 deletions src/compat.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if isdefined(FileIO, :action)
# FileIO >= 1.6
_png_stream(io) = FileIO.Stream{format"PNG"}(io)
else
_png_stream(io) = FileIO.Stream(format"PNG", io)
end
4 changes: 2 additions & 2 deletions src/showmime.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ function Base.show(io::IO, mime::MIME"image/png", img::AbstractMatrix{C};
r[[coords_spatial(img)...]] .= fac
img = repeat(img, inner=r)
end
FileIO.save(FileIO.Stream(format"PNG", io), img, mapi=mapi)
FileIO.save(_png_stream(io), img, mapi=mapi)
else
FileIO.save(FileIO.Stream(format"PNG", io), img)
FileIO.save(_png_stream(io), img)
end
end

Expand Down