format_parser 2.7.1 → 2.7.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5d2679a365f7c735d2b8c962765c4783b6336bf23461ffde1705ab141d250591
4
- data.tar.gz: e1e4b4caa2956cbf1653d39498a9db84589cd0c9c979c6d84e9f3b3027427274
3
+ metadata.gz: 41515e692a4ba72edc213859230083a47f91b649f05fe1c4b1aeccdfd7eac149
4
+ data.tar.gz: 71829cb1c447121aa4384237b83732d1bcb6b29bd9aa460950963029c8fdc1b3
5
5
  SHA512:
6
- metadata.gz: 52e775ae2a4ced22d2879fff48108974bfe4087333b70d74c5c0910229aa7298826664bbd474dd9b4221777637cc51bf969735a830df976f58f0ff7302dd69c5
7
- data.tar.gz: 31b8f95ff8fbcba01d60fe2377699a9abebc61a28d74afc05aa8456d6660f786ee268c2a621c0dc83490e3f9b04dc5e1a60319ae6f4c54503b3dfab9d39d520e
6
+ metadata.gz: cafea2033f3f00535897be3ca2c1c15918b1a826978be14af4e9156249908e5950b1077908eb275c7f11e7f61f9c15507a5823a50623bdb410c6b274cb27a3e8
7
+ data.tar.gz: 9164177d753a9258d3966cf07b38ecf3121975ba9f19e42cc93834b2fa26b1d60e6756fcde11f1832e8c2b2cc7accc3926ed752b5ff1a1bb88baf9bb8ac03d1a
@@ -1,3 +1,3 @@
1
1
  module FormatParser
2
- VERSION = '2.7.1'
2
+ VERSION = '2.7.2'
3
3
  end
@@ -67,7 +67,7 @@ class FormatParser::MP4Parser
67
67
  private
68
68
 
69
69
  def file_format(box_tree)
70
- major_brand = box_tree.find { |box| box.type == 'ftyp' }&.fields[:major_brand]
70
+ major_brand = box_tree.find { |box| box.type == 'ftyp' }&.fields&.[](:major_brand)
71
71
  BRAND_FORMATS[major_brand.downcase] if major_brand
72
72
  end
73
73
 
@@ -31,6 +31,17 @@ describe FormatParser::MP4Parser do
31
31
  end
32
32
  end
33
33
 
34
+ context "when when magic bytes are present but the 'ftyp' box can't be parsed" do
35
+ let(:io) do
36
+ input = [0xFF].pack('N') + 'ftyp' + 'avc1 ' + [0x1].pack('N')
37
+ StringIO.new(input)
38
+ end
39
+
40
+ it 'should be nil' do
41
+ expect(subject.call(io)).to be_nil
42
+ end
43
+ end
44
+
34
45
  Dir.glob(fixtures_dir + '/MP4/valid/video/*.*').sort.each do |path|
35
46
  context "for #{path}" do
36
47
  let(:result) { subject.call(File.open(path, 'rb')) }
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: format_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Berman
8
8
  - Julik Tarkhanov
9
- autorequire:
9
+ autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2023-08-24 00:00:00.000000000 Z
12
+ date: 2023-09-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: exifr
@@ -319,7 +319,7 @@ licenses:
319
319
  - MIT (Hippocratic)
320
320
  metadata:
321
321
  allowed_push_host: https://rubygems.org
322
- post_install_message:
322
+ post_install_message:
323
323
  rdoc_options: []
324
324
  require_paths:
325
325
  - lib
@@ -334,8 +334,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
334
334
  - !ruby/object:Gem::Version
335
335
  version: '0'
336
336
  requirements: []
337
- rubygems_version: 3.1.6
338
- signing_key:
337
+ rubygems_version: 3.3.7
338
+ signing_key:
339
339
  specification_version: 4
340
340
  summary: A library for efficient parsing of file metadata
341
341
  test_files: []