Class: FormatParser::JPEGParser
- Inherits:
-
Object
- Object
- FormatParser::JPEGParser
- Includes:
- EXIFParser, IOUtils
- Defined in:
- lib/parsers/jpeg_parser.rb
Defined Under Namespace
Classes: InvalidStructure
Constant Summary collapse
- JPEG_SOI_MARKER_HEAD =
[0xFF, 0xD8].pack('C2')
- SOF_MARKERS =
[0xC0..0xC3, 0xC5..0xC7, 0xC9..0xCB, 0xCD..0xCF]
- EOI_MARKER =
end of image
0xD9
- SOS_MARKER =
start of stream
0xDA
- APP1_MARKER =
maybe EXIF
0xE1
- EXIF_MAGIC_STRING =
"Exif\0\0".b
- MUST_FIND_NEXT_MARKER_WITHIN_BYTES =
1024
Constants included from EXIFParser
EXIFParser::ORIENTATIONS, EXIFParser::ROTATED_ORIENTATIONS
Instance Method Summary collapse
Methods included from EXIFParser
Methods included from IOUtils
Instance Method Details
#call(io) ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/parsers/jpeg_parser.rb', line 16 def call(io) @buf = FormatParser::IOConstraint.new(io) @width = nil @height = nil @exif_data = nil scan end |