format_parser 2.2.0 → 2.2.1
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/CHANGELOG.md +3 -0
- data/lib/format_parser/version.rb +1 -1
- data/lib/parsers/moov_parser.rb +3 -3
- data/spec/parsers/moov_parser_spec.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f6351170e3d5041a34054745370b1e50e219997b48bbd7eba1f49e86c486b18
|
4
|
+
data.tar.gz: 5e7c4f318f65148297750a64d820e94fdc3c37c17048f67ca65a5989222c6bd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bd5598d0723537436fe746aac8b1fd65e654c4234f7749bf4a809ca0acb71f29a1c33b3887ba694e0fff47cada90c75c649f546358e9ca14ae688b012c42578
|
7
|
+
data.tar.gz: b765e56a4cb4d589dbd8c489533d38b90ab8c42f3cdca061fdc8edb30b4012546f39ff2aebc03d37a33907f81bb6c4809039466f8055bbb75f9044475bc85006
|
data/CHANGELOG.md
CHANGED
data/lib/parsers/moov_parser.rb
CHANGED
@@ -107,12 +107,12 @@ class FormatParser::MOOVParser
|
|
107
107
|
end
|
108
108
|
|
109
109
|
# An MPEG4/MOV/M4A will start with the "ftyp" atom. The atom must have a length
|
110
|
-
# of at least
|
110
|
+
# of at least 16 (to accomodate the atom size and the atom type itself) plus the major brand
|
111
111
|
# and minor version fields. If we cannot find it we can be certain this is not our file.
|
112
112
|
def matches_moov_definition?(io)
|
113
|
-
maybe_atom_size, maybe_ftyp_atom_signature = safe_read(io,
|
113
|
+
maybe_atom_size, maybe_ftyp_atom_signature, maybe_major_brand = safe_read(io, 12).unpack('N1a4a4')
|
114
114
|
minimum_ftyp_atom_size = 4 + 4 + 4 + 4
|
115
|
-
maybe_atom_size >= minimum_ftyp_atom_size && maybe_ftyp_atom_signature == 'ftyp'
|
115
|
+
maybe_atom_size >= minimum_ftyp_atom_size && maybe_ftyp_atom_signature == 'ftyp' && maybe_major_brand != 'crx '
|
116
116
|
end
|
117
117
|
|
118
118
|
# Sample information is found in the 'time-to-sample' stts atom.
|
@@ -135,4 +135,10 @@ describe FormatParser::MOOVParser do
|
|
135
135
|
expect(result).not_to be_nil
|
136
136
|
expect(result.format).to eq(:mov)
|
137
137
|
end
|
138
|
+
|
139
|
+
it 'does not parse CR3 files' do
|
140
|
+
cr3_path = fixtures_dir + '/CR3/Canon EOS R10 (RAW).CR3'
|
141
|
+
result = subject.call(File.open(cr3_path, 'rb'))
|
142
|
+
expect(result).to be_nil
|
143
|
+
end
|
138
144
|
end
|