format_parser 0.14.0 → 0.14.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/care.rb +1 -0
- data/lib/format_parser/version.rb +1 -1
- data/lib/parsers/jpeg_parser.rb +8 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90513000619c11b5a98669f465add204ca68465065681424627adcdf66c634dd
|
4
|
+
data.tar.gz: 1515277ec5edc3bedc7631a7a3e5b56975010e1d7a84b5e166b4eae6977eb90a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec36c70f585ebc72089be82bba55b21b83d53d59a4233f33be4e78cbde5f7b12bdb99587238a00cfdf023a24daafadc8803d43e88bacd994c97cfe47c3aac4f1
|
7
|
+
data.tar.gz: 1e964c45d81b43def5575331f02f0949892ddc06f006c7b83275f72cffafefef25cef6b2b8627db0edb6969a8da1e72fa612f600091630fe0822f842062e75d1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 0.14.1
|
2
|
+
* Care caching: Clear pages more deliberately instead of relegating them to GC
|
3
|
+
* JPEG: Clear the EXIF buffer explicitly
|
4
|
+
|
1
5
|
## 0.14.0
|
2
6
|
* PDF: Reduce the PDF parser to the basic binary detection (PDF/not PDF) until we have a better/more robust PDF parser
|
3
7
|
* MP3: Fix the byte length of MPEG frames calculation to correctly account for ID3V1 and ID3V2 instead of ID3V1 twice
|
data/lib/care.rb
CHANGED
data/lib/parsers/jpeg_parser.rb
CHANGED
@@ -134,12 +134,13 @@ class FormatParser::JPEGParser
|
|
134
134
|
# seek to the start of the next marker and return
|
135
135
|
return unless maybe_exif_magic_str == EXIF_MAGIC_STRING
|
136
136
|
|
137
|
-
# ...and only then read the marker contents and parse it as EXIF
|
138
|
-
|
137
|
+
# ...and only then read the marker contents and parse it as EXIF.
|
138
|
+
# Use StringIO.new instead of #write - https://github.com/aws/aws-sdk-ruby/issues/785#issuecomment-95456838
|
139
|
+
exif_buf = StringIO.new(safe_read(@buf, app1_frame_content_length - EXIF_MAGIC_STRING.bytesize))
|
139
140
|
|
140
|
-
Measurometer.add_distribution_value('format_parser.JPEGParser.bytes_sent_to_exif_parser',
|
141
|
+
Measurometer.add_distribution_value('format_parser.JPEGParser.bytes_sent_to_exif_parser', exif_buf.size)
|
141
142
|
|
142
|
-
@exif_data = exif_from_tiff_io(
|
143
|
+
@exif_data = exif_from_tiff_io(exif_buf)
|
143
144
|
rescue EXIFR::MalformedTIFF
|
144
145
|
# Not a JPEG or the Exif headers contain invalid data, or
|
145
146
|
# an APP1 marker was detected in a file that is not a JPEG
|
@@ -147,6 +148,9 @@ class FormatParser::JPEGParser
|
|
147
148
|
# Reposition the file pointer to where the next marker will begin,
|
148
149
|
# regardless whether we did find usable EXIF or not
|
149
150
|
@buf.seek(marker_length_at + 2 + app1_frame_content_length)
|
151
|
+
|
152
|
+
# Make sure to explicitly clear the EXIF buffers since they can be large
|
153
|
+
exif_buf.truncate(0) if exif_buf
|
150
154
|
end
|
151
155
|
|
152
156
|
def read_frame
|
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: 0.14.
|
4
|
+
version: 0.14.1
|
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: 2018-
|
12
|
+
date: 2018-07-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ks
|