wahwah 1.6.0 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wahwah/helper.rb +9 -1
- data/lib/wahwah/id3/image_frame_body.rb +2 -2
- data/lib/wahwah/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d366d9e5b09b02f94de258c09e03b9d107dda83fe31052bf9b93696e669aac08
|
4
|
+
data.tar.gz: 5a6cc11a98174b658d2b35d3440940023e7aec4a2cb964636c58930d9690338a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 47ad25531fe9835c08f0db10ca919cb73f5688237d19586e7b4f0b7cfacd85c176d2e6555243a1ed566c092dcfea83f39fd9f5c9869240f9a0f3b4b2c056bd64
|
7
|
+
data.tar.gz: 8284a87d145252d60146f5bf2a2fa42c0201422b72ecc4755388a65ff6d2e890b2d029059d9c5d7199b9dd7f873309e38b0890faeae8a3910b960e38556f4c53
|
data/lib/wahwah/helper.rb
CHANGED
@@ -22,7 +22,15 @@ module WahWah
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def self.split_with_terminator(string, terminator_size)
|
25
|
-
|
25
|
+
terminator = ("\x00" * terminator_size).b
|
26
|
+
|
27
|
+
(0...string.size).step(terminator_size).each do |index|
|
28
|
+
if string[index...(index + terminator_size)] == terminator
|
29
|
+
return [string[0...index], string[index + terminator_size..]]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
[]
|
26
34
|
end
|
27
35
|
|
28
36
|
def self.file_format(io)
|
@@ -49,9 +49,9 @@ module WahWah
|
|
49
49
|
# Picture data <binary data>
|
50
50
|
def parse
|
51
51
|
frame_format = @version > 2 ? "CZ*Ca*" : "Ca3Ca*"
|
52
|
-
encoding_id, @mime_type, type_index,
|
52
|
+
encoding_id, @mime_type, type_index, rest_content = @content.unpack(frame_format)
|
53
53
|
encoding = ENCODING_MAPPING[encoding_id]
|
54
|
-
_description, data = Helper.split_with_terminator(
|
54
|
+
_description, data = Helper.split_with_terminator(rest_content, ENCODING_TERMINATOR_SIZE[encoding])
|
55
55
|
|
56
56
|
@value = {data: data, mime_type: mime_type, type: TYPES[type_index]}
|
57
57
|
end
|
data/lib/wahwah/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wahwah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aidewoode
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-06-
|
11
|
+
date: 2024-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|