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

read, recognized?

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.



117
118
119
120
121
122
123
124
# File 'lib/vips/reader.rb', line 117

def initialize(path, options={})
  @page_number = nil
  @sequential = false

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

Instance Attribute Details

#page_numberObject

Returns the value of attribute page_number.



113
114
115
# File 'lib/vips/reader.rb', line 113

def page_number
  @page_number
end

#sequentialObject

Returns the value of attribute sequential.



114
115
116
# File 'lib/vips/reader.rb', line 114

def sequential
  @sequential
end

Instance Method Details

#readObject

Read the tiff file from disk and return a VIPS Image object.



127
128
129
130
131
132
133
134
# File 'lib/vips/reader.rb', line 127

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

  read_internal str
end