Skip to content

Commit

Permalink
Add :full_fidelity IOContext to mime writer
Browse files Browse the repository at this point in the history
  • Loading branch information
davidanthoff committed Jun 13, 2017
1 parent 01737e2 commit 11e6e84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mimesave.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
function FileIO.save(file::File{format"PNG"}, data)
if mimewritable("image/png", data)
open(file.filename, "w") do s
show(s, "image/png", data)
show(IOContext(s, :full_fidelity=>true), "image/png", data)
end
else
throw(ArgumentError("Argument does not support conversion to png."))
Expand All @@ -11,7 +11,7 @@ end
function FileIO.save(file::File{format"SVG"}, data)
if mimewritable("image/svg+xml", data)
open(file.filename, "w") do s
show(s, "image/svg+xml", data)
show(IOContext(s, :full_fidelity=>true), "image/svg+xml", data)
end
else
throw(ArgumentError("Argument does not support conversion to svg."))
Expand All @@ -21,7 +21,7 @@ end
function FileIO.save(file::File{format"PDF"}, data)
if mimewritable("application/pdf", data)
open(file.filename, "w") do s
show(s, "application/pdf", data)
show(IOContext(s, :full_fidelity=>true), "application/pdf", data)
end
else
throw(ArgumentError("Argument does not support conversion to pdf."))
Expand All @@ -31,7 +31,7 @@ end
function FileIO.save(file::File{format"EPS"}, data)
if mimewritable("application/eps", data)
open(file.filename, "w") do s
show(s, "application/eps", data)
show(IOContext(s, :full_fidelity=>true), "application/eps", data)
end
else
throw(ArgumentError("Argument does not support conversion to eps."))
Expand Down

0 comments on commit 11e6e84

Please sign in to comment.