lib/isodoc/function/utils.rb in isodoc-2.5.10 vs lib/isodoc/function/utils.rb in isodoc-2.6.0
- old
+ new
@@ -174,9 +174,10 @@
def save_dataimage(uri, _relative_dir = true)
%r{^data:(?<imgclass>image|application)/(?<imgtype>[^;]+);(?:charset=[^;]+;)?base64,(?<imgdata>.+)$} =~ uri
imgtype = "emf" if emf?("#{imgclass}/#{imgtype}")
imgtype = imgtype.sub(/\+[a-z0-9]+$/, "") # svg+xml
imgtype = "png" unless /^[a-z0-9]+$/.match? imgtype
+ imgtype == "postscript" and imgtype = "eps"
Tempfile.open(["image", ".#{imgtype}"]) do |f|
f.binmode
f.write(Base64.strict_decode64(imgdata))
@tempfile_cache << f # persist to the end
f.path