only try the pdf -> png convert if the backend support application/pdf mime

This commit is contained in:
Fredrik Ekre 2018-05-21 14:49:18 +02:00
parent 12e5937a91
commit 27e68ed6a9

View File

@ -218,9 +218,10 @@ closeall() = closeall(backend())
# ---------------------------------------------------------
# A backup, if no PNG generation is defined, is to try to make a PDF and use FileIO to convert
const PDFBackends = Union{PGFPlotsBackend,PlotlyJSBackend,PyPlotBackend,InspectDRBackend,GRBackend}
if is_installed("FileIO")
@eval import FileIO
function _show(io::IO, ::MIME"image/png", plt::Plot)
function _show(io::IO, ::MIME"image/png", plt::Plot{<:PDFBackends})
fn = tempname()
# first save a pdf file