phantom_svg 1.0.5 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/phantom/parser/gif_reader.rb +9 -8
- data/phantom_svg.gemspec +3 -3
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bef19b043049de58cbe8f6f6b1760f25415760d7
|
4
|
+
data.tar.gz: 42612111601ec34a3383ff81909a95c2e403397b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42c97170d698d23a0adba93a12f9fe6e8f0021b5a0d10b4f10e5bbda198354a072747f2f5fb7ed8e17cec461564eeb006bdf91ccb2dd83b1229f9c382e506229
|
7
|
+
data.tar.gz: 61dc006678e0d5524381c1d198fcd1b1638032cac52342671bf31ddf0a31b698b88d4aa67041a948f061ca53b4e4ea93d0a8b504e5e6bbd73eb8dfc8c762acd4
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'rexml/document'
|
2
2
|
require 'RMagick'
|
3
3
|
require 'rsvg2'
|
4
|
+
require 'base64'
|
4
5
|
|
5
6
|
require_relative '../frame'
|
6
7
|
require_relative 'abstract_image_reader'
|
@@ -35,8 +36,8 @@ module Phantom
|
|
35
36
|
frame.width = "#{img.columns}px"
|
36
37
|
frame.height = "#{img.rows}px"
|
37
38
|
frame.viewbox.set_from_text("0 0 #{img.columns} #{img.rows}")
|
38
|
-
frame.surfaces = create_surfaces(
|
39
|
-
frame.duration = img.delay *
|
39
|
+
frame.surfaces = create_surfaces(img)
|
40
|
+
frame.duration = img.delay * 0.1 unless img.delay.nil?
|
40
41
|
frame.namespaces = {
|
41
42
|
'xmlns' => 'http://www.w3.org/2000/svg',
|
42
43
|
'xlink' => 'http://www.w3.org/1999/xlink'
|
@@ -47,15 +48,15 @@ module Phantom
|
|
47
48
|
end
|
48
49
|
|
49
50
|
# Create surfaces.
|
50
|
-
def create_surfaces(
|
51
|
-
|
52
|
-
base64 =
|
51
|
+
def create_surfaces(img)
|
52
|
+
img.format = 'PNG'
|
53
|
+
base64 = Base64.encode64(img.to_blob)
|
53
54
|
|
54
55
|
image = REXML::Element.new('image')
|
55
56
|
image.add_attributes(
|
56
|
-
'width' =>
|
57
|
-
'height' =>
|
58
|
-
'xlink:href' => "data:image/
|
57
|
+
'width' => img.columns,
|
58
|
+
'height' => img.rows,
|
59
|
+
'xlink:href' => "data:image/png;base64,#{base64}"
|
59
60
|
)
|
60
61
|
|
61
62
|
[image]
|
data/phantom_svg.gemspec
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.platform = Gem::Platform::RUBY
|
3
3
|
s.name = 'phantom_svg'
|
4
|
-
s.version = '1.0
|
5
|
-
s.license = 'LGPL-3
|
4
|
+
s.version = '1.1.0'
|
5
|
+
s.license = 'LGPL-3'
|
6
6
|
s.summary = 'Hight end SVG manipulation tools for Ruby'
|
7
7
|
s.description = 'Hight end SVG manipulation tools for Ruby.\n' \
|
8
8
|
'Includes chained keyframe generation, (A)PNG conversion and more.'
|
9
|
-
s.authors = ['Rika Yoshida', '
|
9
|
+
s.authors = ['Rika Yoshida', 'Naoki Iwakawa', 'Rei Kagetsuki']
|
10
10
|
s.email = 'info@genshin.org'
|
11
11
|
s.homepage = 'http://github.com/Genshin/phantom_svg'
|
12
12
|
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phantom_svg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rika Yoshida
|
8
|
-
- Rei Kagetsuki
|
9
8
|
- Naoki Iwakawa
|
9
|
+
- Rei Kagetsuki
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2014-10-
|
13
|
+
date: 2014-10-09 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: cairo
|
@@ -162,7 +162,7 @@ files:
|
|
162
162
|
- spec/spec_helper.rb
|
163
163
|
homepage: http://github.com/Genshin/phantom_svg
|
164
164
|
licenses:
|
165
|
-
- LGPL-3
|
165
|
+
- LGPL-3
|
166
166
|
metadata: {}
|
167
167
|
post_install_message:
|
168
168
|
rdoc_options: []
|
@@ -248,4 +248,3 @@ test_files:
|
|
248
248
|
- spec/images/test_raster.png
|
249
249
|
- spec/phantom/svg_spec.rb
|
250
250
|
- spec/spec_helper.rb
|
251
|
-
has_rdoc:
|