Class: VIPS::PNGReader
- Defined in:
- lib/vips/reader.rb,
ext/reader.c
Instance Attribute Summary collapse
-
#sequential ⇒ Object
Returns the value of attribute sequential.
Attributes inherited from Reader
Instance Method Summary collapse
-
#initialize(path, options = {}) ⇒ PNGReader
constructor
Create a png image file reader.
- #read ⇒ Object
- #read_buffer ⇒ Object
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, ={}) @sequential = [:sequential] || false super path, end |
Instance Attribute Details
#sequential ⇒ Object
Returns the value of attribute sequential.
188 189 190 |
# File 'lib/vips/reader.rb', line 188 def sequential @sequential end |
Instance Method Details
#read ⇒ Object
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_buffer ⇒ Object
212 213 214 |
# File 'lib/vips/reader.rb', line 212 def read_buffer @_im = buf_internal @path end |