format_parser 0.24.2 → 0.25.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b680c35747790df90503edc5cb7ddda0d8929ab47c945fe6c13f5fa4319ba747
4
- data.tar.gz: e8cf15c34f0422a99f3e09b30ab7ca50d54c17f2933762414323f34f06100260
3
+ metadata.gz: c24092543b6c98c713b07a45c3e3a2990332858397e11f6709470c32343a62f3
4
+ data.tar.gz: 0222b05ddfa1efa7cee364db7ad61ae7d44806b9622d6d6012fbb50e1b2e8138
5
5
  SHA512:
6
- metadata.gz: 658e3d789e95c20b7a30e4a4c0cdb37fc186b0b696d8bfa1fd7b7b500bb375dfc0dc6873f908e20c45e871ac3831231adad3589457073bdf13697c79677b450f
7
- data.tar.gz: 669af5c03327b8e048cee8401ac340b77b5bb990d08b4786c402451a092fdbea1d4a106a6404a6ac711baed2171eced775b37e5e5979e130fea2e833380e7598
6
+ metadata.gz: 67a3a64166115ef70b2043c05e9c105c2939752b1de34086421a2b96311880673d1c668927eecf904e06db368cc9979218d666004b59a187f52e569f47e9d2a3
7
+ data.tar.gz: 5f4034dbcc2a92cb4908c6609465fbb81ec5011f42f22e9c5477b72a26ee4b59bbaa1191a13a5405d71f68ac8b8c0ceac652befd9eb2c1ea9fc5af000b221828
@@ -1,3 +1,7 @@
1
+ ## 0.25.0
2
+ * MP3: add suport to id3 v2.4.x
3
+ * JPEG: Update gem exifr to 1.3.8 to fix a bug
4
+
1
5
  ## 0.24.2
2
6
  * Update gem id3tag to 0.14.0 to fix MP3 issues
3
7
 
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.require_paths = ['lib']
32
32
 
33
33
  spec.add_dependency 'ks', '~> 0.0'
34
- spec.add_dependency 'exifr', '~> 1', '>= 1.3.7'
34
+ spec.add_dependency 'exifr', '~> 1', '>= 1.3.8'
35
35
  spec.add_dependency 'id3tag', '~> 0.14'
36
36
  spec.add_dependency 'faraday', '~> 0.13'
37
37
  spec.add_dependency 'measurometer', '~> 1'
@@ -1,3 +1,3 @@
1
1
  module FormatParser
2
- VERSION = '0.24.2'
2
+ VERSION = '0.25.0'
3
3
  end
@@ -1,6 +1,8 @@
1
1
  module FormatParser::MP3Parser::ID3Extraction
2
2
  ID3V1_TAG_SIZE_BYTES = 128
3
- ID3V2_TAG_VERSIONS = ["\x43\x00".b, "\x03\x00".b, "\x02\x00".b]
3
+ # it supports 2.4.x, 2.3.x, 2.2.x which are supported by the gem id3tag
4
+ # see https://id3.org/Developer%20Information for more details of each version
5
+ ID3V2_MINOR_TAG_VERSIONS = [2, 3, 4]
4
6
  MAX_SIZE_FOR_ID3V2 = 1 * 1024 * 1024
5
7
 
6
8
  extend FormatParser::IOUtils
@@ -22,7 +24,7 @@ module FormatParser::MP3Parser::ID3Extraction
22
24
  io.seek(0) # Only support header ID3v2
23
25
  header = parse_id3_v2_header(io)
24
26
  return unless header[:tag] == 'ID3' && header[:size] > 0
25
- return unless ID3V2_TAG_VERSIONS.include?(header[:version])
27
+ return unless ID3V2_MINOR_TAG_VERSIONS.include?(header[:version].unpack('C').first)
26
28
 
27
29
  id3_tag_size = io.pos + header[:size]
28
30
 
@@ -73,7 +73,7 @@ describe FormatParser::MP3Parser do
73
73
 
74
74
  large_syncsfe_size = [ID3Tag::SynchsafeInteger.encode(more_bytes_than_permitted)].pack('N')
75
75
  prepped = StringIO.new(
76
- 'ID3' + "\x43\x00".b + "\x00".b + large_syncsfe_size + gunk
76
+ 'ID3' + "\x03\x00".b + "\x00".b + large_syncsfe_size + gunk
77
77
  )
78
78
 
79
79
  expect(ID3Tag).not_to receive(:read)
@@ -144,6 +144,14 @@ describe FormatParser::MP3Parser do
144
144
  }.to raise_error(FormatParser::IOUtils::InvalidRead)
145
145
  end
146
146
 
147
+ it 'supports id3 v2.4.x' do
148
+ fpath = fixtures_dir + '/MP3/id3v24.mp3'
149
+
150
+ parsed = subject.call(File.open(fpath, 'rb'))
151
+
152
+ expect(parsed.artist). to eq('wetransfer')
153
+ end
154
+
147
155
  describe '#as_json' do
148
156
  it 'converts all hash keys to string when stringify_keys: true' do
149
157
  fpath = fixtures_dir + '/MP3/Cassy.mp3'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: format_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.24.2
4
+ version: 0.25.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Berman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-09-18 00:00:00.000000000 Z
12
+ date: 2020-09-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ks
@@ -34,7 +34,7 @@ dependencies:
34
34
  version: '1'
35
35
  - - ">="
36
36
  - !ruby/object:Gem::Version
37
- version: 1.3.7
37
+ version: 1.3.8
38
38
  type: :runtime
39
39
  prerelease: false
40
40
  version_requirements: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '1'
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 1.3.7
47
+ version: 1.3.8
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: id3tag
50
50
  requirement: !ruby/object:Gem::Requirement
@@ -292,7 +292,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
292
  - !ruby/object:Gem::Version
293
293
  version: '0'
294
294
  requirements: []
295
- rubygems_version: 3.0.3
295
+ rubygems_version: 3.1.2
296
296
  signing_key:
297
297
  specification_version: 4
298
298
  summary: A library for efficient parsing of file metadata