Merge pull request #338 from jheinen/dev
use temporary files when generating MIME files
This commit is contained in:
commit
b232410d25
@ -896,11 +896,14 @@ for (mime, fmt) in _gr_mimeformats
|
|||||||
@eval function _writemime(io::IO, ::MIME{Symbol($mime)}, plt::Plot{GRBackend})
|
@eval function _writemime(io::IO, ::MIME{Symbol($mime)}, plt::Plot{GRBackend})
|
||||||
GR.emergencyclosegks()
|
GR.emergencyclosegks()
|
||||||
wstype = haskey(ENV, "GKS_WSTYPE") ? ENV["GKS_WSTYPE"] : "0"
|
wstype = haskey(ENV, "GKS_WSTYPE") ? ENV["GKS_WSTYPE"] : "0"
|
||||||
|
filepath = tempname() * "." * $fmt
|
||||||
ENV["GKS_WSTYPE"] = $fmt
|
ENV["GKS_WSTYPE"] = $fmt
|
||||||
|
ENV["GKS_FILEPATH"] = filepath
|
||||||
gr_display(plt)
|
gr_display(plt)
|
||||||
GR.emergencyclosegks()
|
GR.emergencyclosegks()
|
||||||
write(io, readall("gks." * $fmt))
|
write(io, readall(filepath))
|
||||||
ENV["GKS_WSTYPE"] = wstype
|
ENV["GKS_WSTYPE"] = wstype
|
||||||
|
rm(filepath)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user