swfheader 0.21 → 0.22
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.
- data/lib/swfheader/swf-header.rb +7 -1
- metadata +50 -35
data/lib/swfheader/swf-header.rb
CHANGED
@@ -4,7 +4,7 @@ module SwfUtil
|
|
4
4
|
def initialize(file)
|
5
5
|
parse_header(file)
|
6
6
|
end
|
7
|
-
attr_accessor :signature,:compression_type,:version,:size,:nbits,:xmax,:ymax,:width,:height,:frame_rate,:frame_count,
|
7
|
+
attr_accessor :signature,:compression_type,:version,:avm_version,:size,:nbits,:xmax,:ymax,:width,:height,:frame_rate,:frame_count,
|
8
8
|
COMPRESSED = "compressed"
|
9
9
|
UNCOMPRESSED = "uncompressed"
|
10
10
|
def parse_header(file)
|
@@ -47,6 +47,11 @@ module SwfUtil
|
|
47
47
|
fc2 = buffer[byte_pointer] & 0xFF
|
48
48
|
byte_pointer+=1
|
49
49
|
@frame_count=(fc2<<8)+fc1
|
50
|
+
|
51
|
+
byte_pointer+=2
|
52
|
+
avm_bit = buffer[byte_pointer] & 0x08
|
53
|
+
@avm_version = (avm_bit == 0) ? "AVM1" : "AVM2"
|
54
|
+
|
50
55
|
buffer=nil
|
51
56
|
end
|
52
57
|
def is_swf?(bytes)
|
@@ -88,6 +93,7 @@ module SwfUtil
|
|
88
93
|
def inspect
|
89
94
|
"signature: "+@signature.to_s+"\n"+
|
90
95
|
"version: "+@version.to_s+"\n"+
|
96
|
+
"avm_version: "+@avm_version.to_s+"\n"+
|
91
97
|
"compression: "+@compression_type.to_s+"\n"+
|
92
98
|
"size: "+@size.to_s+"\n"+
|
93
99
|
"nbits: "+@nbits.to_s+"\n"+
|
metadata
CHANGED
@@ -1,35 +1,32 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
2
|
name: swfheader
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
email: killme2008@gmail.com
|
12
|
-
homepage: http://www.blogjava.net/killme2008
|
13
|
-
rubyforge_project:
|
14
|
-
description:
|
15
|
-
autorequire: swfheader
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: false
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 22
|
8
|
+
version: "0.22"
|
25
9
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
10
|
authors:
|
30
11
|
- Dennis Zhuang
|
12
|
+
- James Smith
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2010-03-09 00:00:00 -08:00
|
18
|
+
default_executable:
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: A lightweight gem for reading swf headers and compressing/decompressing swf files.
|
22
|
+
email: killme2008@gmail.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files:
|
28
|
+
- README
|
31
29
|
files:
|
32
|
-
- lib/swfheader
|
33
30
|
- lib/swfheader/packed-bit-obj.rb
|
34
31
|
- lib/swfheader/swf-compression.rb
|
35
32
|
- lib/swfheader/swf-compressor.rb
|
@@ -39,17 +36,35 @@ files:
|
|
39
36
|
- lib/swfheader.rb
|
40
37
|
- test/test.rb
|
41
38
|
- README
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
extra_rdoc_files:
|
47
|
-
- README
|
48
|
-
executables: []
|
39
|
+
has_rdoc: true
|
40
|
+
homepage: http://www.blogjava.net/killme2008
|
41
|
+
licenses: []
|
49
42
|
|
50
|
-
|
43
|
+
post_install_message:
|
44
|
+
rdoc_options: []
|
51
45
|
|
46
|
+
require_paths:
|
47
|
+
- lib
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
requirements:
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
segments:
|
53
|
+
- 0
|
54
|
+
version: "0"
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
segments:
|
60
|
+
- 0
|
61
|
+
version: "0"
|
52
62
|
requirements: []
|
53
63
|
|
54
|
-
|
55
|
-
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 1.3.6
|
66
|
+
signing_key:
|
67
|
+
specification_version: 3
|
68
|
+
summary: Reading swf headers and compress/decompress swf files
|
69
|
+
test_files:
|
70
|
+
- test/test.rb
|