Class: VIPS::JPEGReader
- Defined in:
- lib/vips/reader.rb,
ext/reader.c
Constant Summary collapse
- SHRINK_FACTOR =
[1, 2, 4, 8]
Instance Attribute Summary collapse
-
#fail_on_warn ⇒ Object
Returns the value of attribute fail_on_warn.
-
#shrink_factor ⇒ Object
Returns the value of attribute shrink_factor.
Attributes inherited from Reader
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ JPEGReader
constructor
Creates a jpeg image file reader.
-
#read ⇒ Object
Read the jpeg file from disk and return a VIPS Image object.
Methods inherited from Reader
Methods included from Header
#band_fmt, #bands, #exif, #exif?, #get, #icc, #icc?, #n_elements, #set, #sizeof_element, #sizeof_line, #sizeof_pel, #x_offset, #x_res, #x_size, #y_offset, #y_res, #y_size
Constructor Details
#initialize(path, options = {}) ⇒ JPEGReader
Creates a jpeg image file reader.
76 77 78 79 80 81 82 83 84 |
# File 'lib/vips/reader.rb', line 76 def initialize(path, ={}) @shrink_factor = 1 @fail_on_warn = false self.shrink_factor = [:shrink_factor] if .has_key?(:shrink_factor) self.fail_on_warn = [:fail_on_warn] if .has_key?(:fail_on_warn) super path, end |
Instance Attribute Details
#fail_on_warn ⇒ Object
Returns the value of attribute fail_on_warn.
71 72 73 |
# File 'lib/vips/reader.rb', line 71 def fail_on_warn @fail_on_warn end |
#shrink_factor ⇒ Object
Returns the value of attribute shrink_factor.
70 71 72 |
# File 'lib/vips/reader.rb', line 70 def shrink_factor @shrink_factor end |
Instance Method Details
#read ⇒ Object
Read the jpeg file from disk and return a VIPS Image object.
87 88 89 90 91 92 |
# File 'lib/vips/reader.rb', line 87 def read str = "#{@path}:#{shrink_factor}" str << ",fail" if @fail_on_warn read_internal str end |