Class: VIPS::TIFFReader

Inherits:
Reader
  • Object
show all
Defined in:
lib/vips/reader.rb,
ext/reader.c

Instance Attribute Summary collapse

Attributes inherited from Reader

#path

Instance Method Summary collapse

Methods inherited from Reader

recognized?, #x_size, #y_size

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 = {}) ⇒ TIFFReader

Create a tiff image file reader.



134
135
136
137
138
139
140
# File 'lib/vips/reader.rb', line 134

def initialize(path, options={})
  @page_number = nil
  @sequential = options[:sequential] || false

  self.page_number = options[:page_number] if options.has_key?(:page_number)
  super path, options
end

Instance Attribute Details

#page_numberObject

Returns the value of attribute page_number.



130
131
132
# File 'lib/vips/reader.rb', line 130

def page_number
  @page_number
end

#sequentialObject

Returns the value of attribute sequential.



131
132
133
# File 'lib/vips/reader.rb', line 131

def sequential
  @sequential
end

Instance Method Details

#readObject



142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'lib/vips/reader.rb', line 142

def read
  str = "#{@path}:"
  str << "#{@page_number}" if @page_number

  seq = 0
  if VIPS.sequential_mode_supported?
    str << ","
    str << "sequential" if @sequential
    seq = 1
  end

  @_im = read_retry str, seq
end