Skip to content

Commit

Permalink
Fixed handling of temporary image files on Windows (2)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxirmx committed Aug 28, 2023
1 parent 2a260e4 commit 3c68647
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/isodoc/function/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def save_dataimage(uri, _relative_dir = true)
imgtype = "png" unless /^[a-z0-9]+$/.match? imgtype
imgtype == "postscript" and imgtype = "eps"
Tempfile.open(["image", ".#{imgtype}"],
mode: File::BINARY | File::SHARE_DELETE) do |f|
mode: File::BINARY | File::SHARE_DELETE,
encoding: "utf-8") do |f|
f.write(Base64.strict_decode64(imgdata))
@tempfile_cache << f # persist to the end
f.path
Expand Down

0 comments on commit 3c68647

Please sign in to comment.