format_parser 2.2.0 → 2.2.1

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: 00a7541231e6ab1309b8fc318595725c4d0ec6de6a5732973b8ed0ac5e3b6393
4
- data.tar.gz: fbd9d67e3cec87e474519bdade15a700694118f75f3ede8757fcb0b0657423f5
3
+ metadata.gz: 2f6351170e3d5041a34054745370b1e50e219997b48bbd7eba1f49e86c486b18
4
+ data.tar.gz: 5e7c4f318f65148297750a64d820e94fdc3c37c17048f67ca65a5989222c6bd6
5
5
  SHA512:
6
- metadata.gz: 05a601a35d26db59f1df83f21fbe96fceff0e96c96ec9f958aa94326a34e95c4c4c585a36182b7c392eb205f5a433758eb1f45df2d726bb2402a89015ac26279
7
- data.tar.gz: e9c935e201680e6740ef764b4836ecb3adddfb7559aab5e78f8a728c1e52bce0e784862a2cf5b73b05c8a3e23c1efcac8d402304dada21d4a404011d403fb604
6
+ metadata.gz: 4bd5598d0723537436fe746aac8b1fd65e654c4234f7749bf4a809ca0acb71f29a1c33b3887ba694e0fff47cada90c75c649f546358e9ca14ae688b012c42578
7
+ data.tar.gz: b765e56a4cb4d589dbd8c489533d38b90ab8c42f3cdca061fdc8edb30b4012546f39ff2aebc03d37a33907f81bb6c4809039466f8055bbb75f9044475bc85006
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 2.2.1
2
+ * Bug fix for `CR3` files being misidentified as `MOOV`.
3
+
1
4
  ## 2.2.0
2
5
  * Add support for `CR3` files.
3
6
  * Add ISO base file format decoding functionality.
@@ -1,3 +1,3 @@
1
1
  module FormatParser
2
- VERSION = '2.2.0'
2
+ VERSION = '2.2.1'
3
3
  end
@@ -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 8 (to accomodate the atom size and the atom type itself) plus the major
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, 8).unpack('N1a4')
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
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: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Berman