Skip to content

fix tempname usage #5023

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading