Class: VIPS::JPEGWriter
- Defined in:
- lib/vips/writer.rb,
ext/writer.c
Instance Attribute Summary collapse
-
#quality ⇒ Object
Returns the value of attribute quality.
Instance Method Summary collapse
-
#initialize(image, options = {}) ⇒ JPEGWriter
constructor
A new instance of JPEGWriter.
- #to_memory ⇒ Object
- #write(path) ⇒ Object
Methods inherited from Writer
#exif=, #icc=, #image, #remove_exif, #remove_icc
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(image, options = {}) ⇒ JPEGWriter
Returns a new instance of JPEGWriter.
49 50 51 52 53 54 55 |
# File 'lib/vips/writer.rb', line 49 def initialize(image, ={}) super image @quality = 75 self.quality = [:quality] if .has_key?(:quality) end |
Instance Attribute Details
#quality ⇒ Object
Returns the value of attribute quality.
47 48 49 |
# File 'lib/vips/writer.rb', line 47 def quality @quality end |
Instance Method Details
#to_memory ⇒ Object
61 62 63 |
# File 'lib/vips/writer.rb', line 61 def to_memory buf_internal @quality end |
#write(path) ⇒ Object
57 58 59 |
# File 'lib/vips/writer.rb', line 57 def write(path) write_gc "#{path}:#{@quality}" end |