Class: VIPS::JPEGWriter

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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.



26
27
28
29
30
31
32
# File 'lib/vips/writer.rb', line 26

def initialize(image, options={})
  super image

  @quality = 75

  self.quality = options[:quality] if options.has_key?(:quality)
end

Instance Attribute Details

#qualityObject

Returns the value of attribute quality.



24
25
26
# File 'lib/vips/writer.rb', line 24

def quality
  @quality
end

Instance Method Details

#to_memoryObject



38
39
40
# File 'lib/vips/writer.rb', line 38

def to_memory
  buf_internal @quality
end

#write(path) ⇒ Object



34
35
36
# File 'lib/vips/writer.rb', line 34

def write(path)
  write_internal "#{path}:#{@quality}"
end