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 +4 -4
- data/lib/format_parser/version.rb +1 -1
- data/lib/parsers/mp4_parser.rb +1 -1
- data/spec/parsers/mp4_parser_spec.rb +11 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41515e692a4ba72edc213859230083a47f91b649f05fe1c4b1aeccdfd7eac149
|
4
|
+
data.tar.gz: 71829cb1c447121aa4384237b83732d1bcb6b29bd9aa460950963029c8fdc1b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cafea2033f3f00535897be3ca2c1c15918b1a826978be14af4e9156249908e5950b1077908eb275c7f11e7f61f9c15507a5823a50623bdb410c6b274cb27a3e8
|
7
|
+
data.tar.gz: 9164177d753a9258d3966cf07b38ecf3121975ba9f19e42cc93834b2fa26b1d60e6756fcde11f1832e8c2b2cc7accc3926ed752b5ff1a1bb88baf9bb8ac03d1a
|
data/lib/parsers/mp4_parser.rb
CHANGED
@@ -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.
|
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-
|
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.
|
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: []
|