Skip to content

Commit

Permalink
fix tempname usage (#5023)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-bltg authored Nov 12, 2024
1 parent a6147ff commit 5644ec9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
matrix:
version:
- '1.6' # LTS (minimal declared julia compat in `Project.toml`)
- 'lts'
- '1' # latest stable
experimental:
- false
Expand Down
2 changes: 1 addition & 1 deletion src/animation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function Base.show(io::IO, ::MIME"text/html", agif::AnimatedGif)
"<img src=\"data:image/png;base64,$(base64encode(read(agif.filename)))\" />"
elseif ext in ("mov", "mp4", "webm")
mimetype = ext == "mov" ? "video/quicktime" : "video/$ext"
"<video controls><source src=\"data:$mimetype;base64,$(base64encode(read(agif.filename)))\" type = \"$mimetype\"></video>"
"<video autoplay controls><source src=\"data:$mimetype;base64,$(base64encode(read(agif.filename)))\" type = \"$mimetype\"></video>"
else
error("Cannot show animation with extension $ext: $agif")
end
Expand Down
2 changes: 1 addition & 1 deletion src/init.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ include(_path(backend_name()))
$func() = begin # evaluate each example in a local scope
$(_examples[i].exprs)
$i == 1 || return # only for one example
fn = joinpath(scratch_dir, tempname())
fn = tempname(scratch_dir)
pl = current()
show(devnull, pl)
showable(MIME"image/png"(), pl) && savefig(pl, "$fn.png")
Expand Down

0 comments on commit 5644ec9

Please sign in to comment.