format_parser 1.4.1 → 1.4.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/CHANGELOG.md +3 -0
- data/lib/format_parser/version.rb +1 -1
- data/lib/parsers/mp3_parser.rb +3 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5a9a94233949cc72d18b433cf1ddcba0e479e8b93aa1ff2e48bda6f6d86f667b
|
4
|
+
data.tar.gz: 4e357bc46207e95cad52d21b2aaa1781e9c231bab02e235be29663db9722f5d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcf8c8aeefc6166f3645dae461aadbcc2b36e96cb7a75162586fc009d562f6f978767ff877b27d0c192b5ca3107011a1bfdda842e730e486ced02e4191b53f59
|
7
|
+
data.tar.gz: fbc2caafb269f5e9c249e6ffe62ea8141477589256fab1bea5d058877d571725b1e619619ef9fcd33005d42759697ae7c7575d7a79217bdedc7e96ab02ce3c1b
|
data/CHANGELOG.md
CHANGED
data/lib/parsers/mp3_parser.rb
CHANGED
@@ -28,6 +28,7 @@ class FormatParser::MP3Parser
|
|
28
28
|
# For some edge cases
|
29
29
|
ZIP_LOCAL_ENTRY_SIGNATURE = "PK\x03\x04\x14\x00".b
|
30
30
|
PNG_HEADER_BYTES = [137, 80, 78, 71, 13, 10, 26, 10].pack('C*')
|
31
|
+
WEBP_HEADER_REGEX = /RIFF.{4}WEBP/i
|
31
32
|
|
32
33
|
MAGIC_LE = [0x49, 0x49, 0x2A, 0x0].pack('C4')
|
33
34
|
MAGIC_BE = [0x4D, 0x4D, 0x0, 0x2A].pack('C4')
|
@@ -68,9 +69,10 @@ class FormatParser::MP3Parser
|
|
68
69
|
# will terminate here. Same with PNGs. In the future
|
69
70
|
# we should implement "confidence" for MP3 as of all our formats
|
70
71
|
# it is by far the most lax.
|
71
|
-
header = safe_read(io,
|
72
|
+
header = safe_read(io, 12)
|
72
73
|
return if header.start_with?(ZIP_LOCAL_ENTRY_SIGNATURE)
|
73
74
|
return if header.start_with?(PNG_HEADER_BYTES)
|
75
|
+
return if header.start_with?(WEBP_HEADER_REGEX)
|
74
76
|
|
75
77
|
io.seek(0)
|
76
78
|
return if TIFF_HEADER_BYTES.include?(safe_read(io, 4))
|
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: 1.4.
|
4
|
+
version: 1.4.2
|
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: 2022-07-
|
12
|
+
date: 2022-07-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ks
|
@@ -319,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
319
319
|
- !ruby/object:Gem::Version
|
320
320
|
version: '0'
|
321
321
|
requirements: []
|
322
|
-
rubygems_version: 3.
|
322
|
+
rubygems_version: 3.3.7
|
323
323
|
signing_key:
|
324
324
|
specification_version: 4
|
325
325
|
summary: A library for efficient parsing of file metadata
|