Class: Vectory::Emf
Instance Attribute Summary
Attributes inherited from Vector
#initial_path
Attributes inherited from Image
#content
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Vector
#convert_with_inkscape, #file_size, from_datauri, from_path, #height, #initialize, #mime, #path, #size, #to_uri, #width, #write
Methods inherited from Image
from_content, from_path, #initialize
Class Method Details
.all_mimetypes ⇒ Object
11
12
13
|
# File 'lib/vectory/emf.rb', line 11
def self.all_mimetypes
[mimetype] + alternative_mimetypes
end
|
.alternative_mimetypes ⇒ Object
19
20
21
|
# File 'lib/vectory/emf.rb', line 19
def self.alternative_mimetypes
["application/x-msmetafile"]
end
|
.default_extension ⇒ Object
7
8
9
|
# File 'lib/vectory/emf.rb', line 7
def self.default_extension
"emf"
end
|
.from_node(node) ⇒ Object
23
24
25
26
27
28
|
# File 'lib/vectory/emf.rb', line 23
def self.from_node(node)
uri = node["src"]
return Vectory::Datauri.new(uri).to_vector if %r{^data:}.match?(uri)
from_path(uri)
end
|
.mimetype ⇒ Object
15
16
17
|
# File 'lib/vectory/emf.rb', line 15
def self.mimetype
"image/emf"
end
|
Instance Method Details
#to_eps ⇒ Object
38
39
40
|
# File 'lib/vectory/emf.rb', line 38
def to_eps
convert_with_inkscape("--export-type=eps", Eps)
end
|
#to_ps ⇒ Object
42
43
44
|
# File 'lib/vectory/emf.rb', line 42
def to_ps
convert_with_inkscape("--export-type=ps", Ps)
end
|
#to_svg ⇒ Object
30
31
32
33
34
35
36
|
# File 'lib/vectory/emf.rb', line 30
def to_svg
with_file("emf") do |input_path|
content = Emf2svg.from_file(input_path)
Svg.from_content(content)
end
end
|