Method: Vips::Image#write_to_file
- Defined in:
- lib/vips8/image.rb
permalink #write_to_file(name, opts = {}) ⇒ Object
Write this image to a file. Save options may be encoded in the filename or given as a hash. For example:
image.write_to_file "fred.jpg[Q=90]"
or equivalently:
image.write_to_file "fred.jpg", :Q => 90
The full set of save options depend on the selected saver. Try something like:
$ vips jpegsave
to see all the available options.
566 567 568 569 570 571 572 573 574 575 576 577 |
# File 'lib/vips8/image.rb', line 566 def write_to_file(name, opts = {}) filename = Vips::filename_get_filename name option_string = Vips:: name saver = Vips::Foreign.find_save filename if saver == nil raise Vips::Error, "No known saver for '#{filename}'." end Vips::call_base saver, self, option_string, [filename, opts] write_gc end |