Class: VIPS::JPEGReader
- Defined in:
- lib/vips/reader.rb,
ext/reader.c more...
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.
-
#sequential ⇒ Object
Returns the value of attribute sequential.
-
#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
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
permalink #initialize(path, options = {}) ⇒ JPEGReader
Creates a jpeg image file reader.
36 37 38 39 40 41 42 |
# File 'lib/vips/reader.rb', line 36 def initialize(path, ={}) @shrink_factor = [:shrink_factor] || 1 @fail_on_warn = [:fail_on_warn] || false @sequential = [:sequential] || false super path, end |
Instance Attribute Details
permalink #fail_on_warn ⇒ Object
Returns the value of attribute fail_on_warn.
30 31 32 |
# File 'lib/vips/reader.rb', line 30 def fail_on_warn @fail_on_warn end |
permalink #sequential ⇒ Object
Returns the value of attribute sequential.
31 32 33 |
# File 'lib/vips/reader.rb', line 31 def sequential @sequential end |
permalink #shrink_factor ⇒ Object
Returns the value of attribute shrink_factor.
29 30 31 |
# File 'lib/vips/reader.rb', line 29 def shrink_factor @shrink_factor end |
Instance Method Details
permalink #read ⇒ Object
[View source]
44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/vips/reader.rb', line 44 def read str = "#{@path}:#{shrink_factor}" str << "," str << "fail" if @fail_on_warn seq = 0 if Vips.sequential_mode_supported? str << "," str << "sequential" if @sequential seq = 1 end @_im = read_internal str, seq end |