Class: Phantom::SVG::Parser::JPEGReader

Inherits:
AbstractImageReader show all
Defined in:
lib/phantom/parser/jpeg_reader.rb

Overview

JPEG reader.

Instance Attribute Summary

Attributes inherited from AbstractImageReader

#frames, #has_animation, #height, #loops, #skip_first, #width

Instance Method Summary collapse

Methods inherited from AbstractImageReader

#initialize

Constructor Details

This class inherits a constructor from Phantom::SVG::Parser::AbstractImageReader

Instance Method Details

#read(path, _options = {}) ⇒ Object

Read jpeg file from path.



13
14
15
16
17
18
19
20
21
22
# File 'lib/phantom/parser/jpeg_reader.rb', line 13

def read(path, _options = {})
  reset

  return if path.nil? || path.empty?

  frame = create_frame(path)
  @frames << frame
  @width = "#{frame.width}"
  @height = "#{frame.height}"
end