Class: VIPS::PNGReader

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

#exif, #exif?, recognized?, #x_size, #y_size

Constructor Details

#initialize(path, options = {}) ⇒ PNGReader

Create a png image file reader.



191
192
193
194
195
# File 'lib/vips/reader.rb', line 191

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

  super path, options
end

Instance Attribute Details

#sequentialObject

Returns the value of attribute sequential.



188
189
190
# File 'lib/vips/reader.rb', line 188

def sequential
  @sequential
end

Instance Method Details

#readObject



197
198
199
200
201
202
203
204
205
206
207
208
209
210
# File 'lib/vips/reader.rb', line 197

def read
  # some old versions of vips (eg. 7.26) have a bug in the png reader where
  # the ':' is not tripped from the filename in the ispng test ... only put
  # the ':' there if we have to
  str = "#{@path}"

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

  @_im = read_retry str, seq
end

#read_bufferObject



212
213
214
# File 'lib/vips/reader.rb', line 212

def read_buffer
  @_im = buf_internal @path
end