Skip to content

Commit 11e6e84

Browse files
committed
Add :full_fidelity IOContext to mime writer
1 parent 01737e2 commit 11e6e84

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/mimesave.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function FileIO.save(file::File{format"PNG"}, data)
22
if mimewritable("image/png", data)
33
open(file.filename, "w") do s
4-
show(s, "image/png", data)
4+
show(IOContext(s, :full_fidelity=>true), "image/png", data)
55
end
66
else
77
throw(ArgumentError("Argument does not support conversion to png."))
@@ -11,7 +11,7 @@ end
1111
function FileIO.save(file::File{format"SVG"}, data)
1212
if mimewritable("image/svg+xml", data)
1313
open(file.filename, "w") do s
14-
show(s, "image/svg+xml", data)
14+
show(IOContext(s, :full_fidelity=>true), "image/svg+xml", data)
1515
end
1616
else
1717
throw(ArgumentError("Argument does not support conversion to svg."))
@@ -21,7 +21,7 @@ end
2121
function FileIO.save(file::File{format"PDF"}, data)
2222
if mimewritable("application/pdf", data)
2323
open(file.filename, "w") do s
24-
show(s, "application/pdf", data)
24+
show(IOContext(s, :full_fidelity=>true), "application/pdf", data)
2525
end
2626
else
2727
throw(ArgumentError("Argument does not support conversion to pdf."))
@@ -31,7 +31,7 @@ end
3131
function FileIO.save(file::File{format"EPS"}, data)
3232
if mimewritable("application/eps", data)
3333
open(file.filename, "w") do s
34-
show(s, "application/eps", data)
34+
show(IOContext(s, :full_fidelity=>true), "application/eps", data)
3535
end
3636
else
3737
throw(ArgumentError("Argument does not support conversion to eps."))

0 commit comments

Comments
 (0)